diff options
| author | Simon Charette <charette.s@gmail.com> | 2023-10-15 21:59:15 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-10-16 05:37:30 +0200 |
| commit | 3b4a571275d967512866012955eb0b3ae486d63c (patch) | |
| tree | 36a2db000304ab32b3a287d11449284c30245e91 /django/db/models/sql | |
| parent | 73b2c63127297e214d3bfdc8d9a96837691fc2a0 (diff) | |
Fixed #34798 -- Fixed QuerySet.aggregate() crash when referencing expressions containing subqueries.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7,
complements e5c844d6f2a4ac6ae674d741b5f1fa2a688cedf4.
Refs #28477, #34551.
Thanks Haldun Komsuoglu for the report.
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index a7839ccb4d..4690fd304d 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -452,7 +452,7 @@ class Query(BaseExpression): # members of `aggregates` to resolve against each others. self.append_annotation_mask([alias]) refs_subquery |= any( - getattr(self.annotations[ref], "subquery", False) + getattr(self.annotations[ref], "contains_subquery", False) for ref in aggregate.get_refs() ) refs_window |= any( |
