1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

Fixed #36405 -- Fixed Aggregate.order_by using OuterRef.

co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
Adam Johnson
2025-05-21 13:48:59 +01:00
committed by Sarah Boyce
parent b8e5a8a9a2
commit c2615a0500
4 changed files with 45 additions and 5 deletions

View File

@@ -120,11 +120,6 @@ class Aggregate(Func):
):
# Aggregates are not allowed in UPDATE queries, so ignore for_save
c = super().resolve_expression(query, allow_joins, reuse, summarize)
c.order_by = (
c.order_by.resolve_expression(query, allow_joins, reuse, summarize)
if c.order_by
else None
)
if summarize:
# Summarized aggregates cannot refer to summarized aggregates.
for ref in c.get_refs():