mirror of
https://github.com/django/django.git
synced 2025-10-27 15:46:10 +00:00
Fixed #36404 -- Fixed Aggregate.filter using OuterRef.
Regression in a76035e925.
Thank you to Simon Charette for the review.
co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
committed by
Sarah Boyce
parent
d2732c30af
commit
b8e5a8a9a2
@@ -95,7 +95,7 @@ class Aggregate(Func):
|
||||
raise TypeError(f"{self.__class__.__name__} does not allow default.")
|
||||
|
||||
self.distinct = distinct
|
||||
self.filter = filter and AggregateFilter(filter)
|
||||
self.filter = None if filter is None else AggregateFilter(filter)
|
||||
self.default = default
|
||||
self.order_by = AggregateOrderBy.from_param(
|
||||
f"{self.__class__.__name__}.order_by", order_by
|
||||
@@ -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.filter = (
|
||||
c.filter.resolve_expression(query, allow_joins, reuse, summarize)
|
||||
if c.filter
|
||||
else None
|
||||
)
|
||||
c.order_by = (
|
||||
c.order_by.resolve_expression(query, allow_joins, reuse, summarize)
|
||||
if c.order_by
|
||||
|
||||
Reference in New Issue
Block a user