diff --git a/club/migrations/0013_alter_club_board_group_alter_club_members_group_and_more.py b/club/migrations/0013_alter_club_board_group_alter_club_members_group_and_more.py index 21480bda..ca736864 100644 --- a/club/migrations/0013_alter_club_board_group_alter_club_members_group_and_more.py +++ b/club/migrations/0013_alter_club_board_group_alter_club_members_group_and_more.py @@ -29,7 +29,7 @@ class Migration(migrations.Migration): migrations.AddConstraint( model_name="membership", constraint=models.CheckConstraint( - check=models.Q(("end_date__gte", models.F("start_date"))), + condition=models.Q(("end_date__gte", models.F("start_date"))), name="end_after_start", ), ), diff --git a/club/models.py b/club/models.py index e7e99cda..fc5aa64b 100644 --- a/club/models.py +++ b/club/models.py @@ -347,7 +347,7 @@ class Membership(models.Model): class Meta: constraints = [ models.CheckConstraint( - check=Q(end_date__gte=F("start_date")), name="end_after_start" + condition=Q(end_date__gte=F("start_date")), name="end_after_start" ), ] diff --git a/com/migrations/0008_alter_news_options_alter_newsdate_options_and_more.py b/com/migrations/0008_alter_news_options_alter_newsdate_options_and_more.py index 98b09b65..f15cd5cb 100644 --- a/com/migrations/0008_alter_news_options_alter_newsdate_options_and_more.py +++ b/com/migrations/0008_alter_news_options_alter_newsdate_options_and_more.py @@ -54,7 +54,7 @@ class Migration(migrations.Migration): migrations.AddConstraint( model_name="newsdate", constraint=models.CheckConstraint( - check=models.Q(("end_date__gte", models.F("start_date"))), + condition=models.Q(("end_date__gte", models.F("start_date"))), name="news_date_end_date_after_start_date", ), ), diff --git a/com/models.py b/com/models.py index 8c7111e8..ebc458e7 100644 --- a/com/models.py +++ b/com/models.py @@ -212,7 +212,7 @@ class NewsDate(models.Model): verbose_name_plural = _("news dates") constraints = [ models.CheckConstraint( - check=Q(end_date__gte=F("start_date")), + condition=Q(end_date__gte=F("start_date")), name="news_date_end_date_after_start_date", ) ] diff --git a/core/migrations/0043_bangroup_alter_group_description_alter_user_groups_and_more.py b/core/migrations/0043_bangroup_alter_group_description_alter_user_groups_and_more.py index daba4097..81cb2332 100644 --- a/core/migrations/0043_bangroup_alter_group_description_alter_user_groups_and_more.py +++ b/core/migrations/0043_bangroup_alter_group_description_alter_user_groups_and_more.py @@ -154,7 +154,7 @@ class Migration(migrations.Migration): migrations.AddConstraint( model_name="userban", constraint=models.CheckConstraint( - check=models.Q(("expires_at__gte", models.F("created_at"))), + condition=models.Q(("expires_at__gte", models.F("created_at"))), name="user_ban_end_after_start", ), ), diff --git a/core/models.py b/core/models.py index 0c65e043..64b4b778 100644 --- a/core/models.py +++ b/core/models.py @@ -745,7 +745,7 @@ class UserBan(models.Model): fields=["ban_group", "user"], name="unique_ban_type_per_user" ), models.CheckConstraint( - check=Q(expires_at__gte=F("created_at")), + condition=Q(expires_at__gte=F("created_at")), name="user_ban_end_after_start", ), ] diff --git a/counter/migrations/0030_returnableproduct_returnableproductbalance_and_more.py b/counter/migrations/0030_returnableproduct_returnableproductbalance_and_more.py index 82378636..a7565b62 100644 --- a/counter/migrations/0030_returnableproduct_returnableproductbalance_and_more.py +++ b/counter/migrations/0030_returnableproduct_returnableproductbalance_and_more.py @@ -58,7 +58,7 @@ class Migration(migrations.Migration): migrations.AddConstraint( model_name="returnableproduct", constraint=models.CheckConstraint( - check=models.Q( + condition=models.Q( ("product", models.F("returned_product")), _negated=True ), name="returnableproduct_product_different_from_returned", diff --git a/counter/models.py b/counter/models.py index 0f46176b..d2b9a927 100644 --- a/counter/models.py +++ b/counter/models.py @@ -1278,7 +1278,7 @@ class ReturnableProduct(models.Model): verbose_name_plural = _("returnable products") constraints = [ models.CheckConstraint( - check=~Q(product=F("returned_product")), + condition=~Q(product=F("returned_product")), name="returnableproduct_product_different_from_returned", violation_error_message=_( "The returnable product cannot be the same as the returned one"