From fc0942ada47c6ed9bbd25f8a1d721ae0e2859776 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 11 Aug 2022 06:32:23 +0200 Subject: [PATCH] Used F.replace_references(). Follow up to 63884829acd207404f2a5c3cc1d6b4cd0a822b70. --- django/contrib/postgres/constraints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/postgres/constraints.py b/django/contrib/postgres/constraints.py index 2e6f7f79981..f71a5874300 100644 --- a/django/contrib/postgres/constraints.py +++ b/django/contrib/postgres/constraints.py @@ -205,7 +205,7 @@ class ExclusionConstraint(BaseConstraint): if isinstance(expression, F): if exclude and expression.name in exclude: return - rhs_expression = replacement_map.get(expression.name, expression) + rhs_expression = expression.replace_references(replacement_map) else: rhs_expression = expression.replace_references(replacement_map) if exclude: