mirror of
https://github.com/ae-utbm/sith.git
synced 2025-08-29 12:15:44 +00:00
replace deprecated CheckConstraint.check by CheckConstraint.condition
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user