From a77c9a4229cfef790ec18001b2cd18bd9c4aedbc Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 13 Apr 2021 11:51:19 +0200 Subject: Fixed #32635 -- Fixed system check crash for reverse o2o relations in CheckConstraint.check and UniqueConstraint.condition. Regression in b7b7df5fbcf44e6598396905136cab5a19e9faff. Thanks Szymon Zmilczak for the report. --- django/db/models/base.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django') diff --git a/django/db/models/base.py b/django/db/models/base.py index 55b1691166..cd5268bed1 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -2105,6 +2105,8 @@ class Model(metaclass=ModelBase): # JOIN must happen at the first lookup. first_lookup = lookups[0] if ( + hasattr(field, 'get_transform') and + hasattr(field, 'get_lookup') and field.get_transform(first_lookup) is None and field.get_lookup(first_lookup) is None ): -- cgit v1.3