mirror of
https://github.com/django/django.git
synced 2025-11-28 14:37:59 +00:00
Fixed #34450 -- Fixed multi-valued JOIN reuse when filtering by expressions.
Thanks Roman Odaisky for the report.
This commit is contained in:
parent
79a3ea83b1
commit
0e1aae7a5f
2 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue