1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #34450 -- Fixed multi-valued JOIN reuse when filtering by expressions.

Thanks Roman Odaisky for the report.
This commit is contained in:
Simon Charette
2023-03-31 13:48:02 -04:00
committed by Mariusz Felisiak
parent 79a3ea83b1
commit 0e1aae7a5f
2 changed files with 20 additions and 1 deletions

View File

@@ -1373,7 +1373,7 @@ class Query(BaseExpression):
if not getattr(filter_expr, "conditional", False):
raise TypeError("Cannot filter against a non-conditional expression.")
condition = filter_expr.resolve_expression(
self, allow_joins=allow_joins, summarize=summarize
self, allow_joins=allow_joins, reuse=can_reuse, summarize=summarize
)
if not isinstance(condition, Lookup):
condition = self.build_lookup(["exact"], condition, True)