From 9d7f39fe62b2c5bbbcde369adc0051edda258a6f Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Tue, 10 Sep 2024 17:42:47 -0400 Subject: [PATCH] fix: change check= to condition= for Django 6 compatibility (#1456) --- terraso_backend/apps/project_management/models/sites.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraso_backend/apps/project_management/models/sites.py b/terraso_backend/apps/project_management/models/sites.py index b97d6f775..a059aa2f8 100644 --- a/terraso_backend/apps/project_management/models/sites.py +++ b/terraso_backend/apps/project_management/models/sites.py @@ -30,7 +30,7 @@ class Meta(BaseModel.Meta): abstract = False constraints = [ models.CheckConstraint( - check=(models.Q(project__isnull=False) | models.Q(owner__isnull=False)) + condition=(models.Q(project__isnull=False) | models.Q(owner__isnull=False)) & (models.Q(project__isnull=True) | models.Q(owner__isnull=True)), name="site_must_be_owned_once", )