Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
django: "4.2"
- python: "3.13"
django: "4.2"
- python: "3.12"
django: "5.1"
- python: "3.13"
django: "5.1"
- python: "3.12"
django: "5.2"
- python: "3.13"
django: "5.2"
- python: "3.12"
django: "6.0"
- python: "3.13"
django: "6.0"

steps:
- uses: actions/checkout@v5
Expand Down
8 changes: 8 additions & 0 deletions docs/releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## Unreleased

### What's new?

- Added support for Django 6.0
- Removed obsolete Django version checks


## 5.1.0

### What's new?
Expand Down
5 changes: 0 additions & 5 deletions flags/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
import django


if django.VERSION < (3, 2):
default_app_config = "flags.apps.DjangoFlagsConfig"
24 changes: 24 additions & 0 deletions flags/migrations/0014_flagstate_unique_constraint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 6.0.2 on 2026-02-10 15:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("flags", "0013_add_required_field"),
]

operations = [
migrations.AlterUniqueTogether(
name="flagstate",
unique_together=set(),
),
migrations.AddConstraint(
model_name="flagstate",
constraint=models.UniqueConstraint(
fields=("name", "condition", "value"),
name="flags_flagstate_unique_name_condition_value",
),
),
]
7 changes: 6 additions & 1 deletion flags/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ class FlagState(models.Model):

class Meta:
app_label = "flags"
unique_together = ("name", "condition", "value")
constraints = [
models.UniqueConstraint(
fields=["name", "condition", "value"],
name="flags_flagstate_unique_name_condition_value",
)
]

def __str__(self):
return (
Expand Down
8 changes: 0 additions & 8 deletions flags/tests/test_conditions_validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import django
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
Expand Down Expand Up @@ -89,13 +88,6 @@ def test_invalid_date_strings(self):
with self.assertRaises(ValidationError):
validate_date("tomorrowish")

# Django 4.0 relies on Python 3.7+'s `datetime.fromisoformat()`, which
# handles this where the old regex did not. This is now valid when on
# Django 4.0+. See https://github.com/django/django/pull/14582
if django.VERSION < (4, 0):
with self.assertRaises(ValidationError):
validate_date("2020-04-01")

def test_valid_date_strings(self):
validate_date("2020-04-01T12:00")
validate_date("2020-04-01T12:00+04:00")
5 changes: 0 additions & 5 deletions flags/tests/testapp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
import django


if django.VERSION < (3, 2):
default_app_config = "flags.tests.testapp.apps.TestAppConfig"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ skipsdist=True
envlist=
lint,
python{3.10,3.13}-django4.2
python{3.12,3.13}-django{5.1,5.2}
python{3.12,3.13}-django5.2
python{3.12,3.13}-django6.0
coverage

[testenv]
Expand All @@ -20,8 +21,8 @@ basepython=

deps=
django4.2: Django~=4.2
django5.1: Django~=5.1
django5.2: Django~=5.2
django6.0: Django~=6.0

[testenv:lint]
basepython=python3.13
Expand Down