diff options
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index f3b2b3da41..b6574eab2e 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -235,7 +235,9 @@ class SQLCompiler: expressions = [ expr for expr in expressions - if expr in pks or getattr(expr, "alias", None) not in aliases + if expr in pks + or expr in having + or getattr(expr, "alias", None) not in aliases ] return expressions |