Skip to content

Commit 4acd63f

Browse files
committed
Update usage deprecated in Django 5.1
The `check` argument was deprecated in Django 5.1. Note that this is incompatible with Django 4.2. See: https://docs.djangoproject.com/en/5.1/ref/models/constraints/#checkconstraint
1 parent 2af8f59 commit 4acd63f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

django_afip/migrations/0011_receiptentry_discount_and_more.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class Migration(migrations.Migration):
2929
migrations.AddConstraint(
3030
model_name="receiptentry",
3131
constraint=models.CheckConstraint(
32-
check=models.Q(("discount__gte", Decimal("0.0"))),
32+
condition=models.Q(("discount__gte", Decimal("0.0"))),
3333
name="discount_positive_value",
3434
),
3535
),
3636
migrations.AddConstraint(
3737
model_name="receiptentry",
3838
constraint=models.CheckConstraint(
39-
check=models.Q(
39+
condition=models.Q(
4040
(
4141
"discount__lte",
4242
django.db.models.expressions.CombinedExpression(

django_afip/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,10 +1693,11 @@ class Meta:
16931693
verbose_name_plural = _("receipt entries")
16941694
constraints = (
16951695
CheckConstraint(
1696-
check=Q(discount__gte=Decimal("0.0")), name="discount_positive_value"
1696+
condition=Q(discount__gte=Decimal("0.0")),
1697+
name="discount_positive_value",
16971698
),
16981699
CheckConstraint(
1699-
check=Q(discount__lte=F("quantity") * F("unit_price")),
1700+
condition=Q(discount__lte=F("quantity") * F("unit_price")),
17001701
name="discount_less_than_total",
17011702
),
17021703
)

0 commit comments

Comments
 (0)