Skip to content
Browse files

Made use of PathInfo.direct flag in trim_joins

Refs #19385
  • Loading branch information...
1 parent 68985db commit 807eff74396faba24ad420236d83e9716feffe1e @akaariai akaariai committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 django/db/models/sql/query.py
View
3 django/db/models/sql/query.py
@@ -1445,8 +1445,7 @@ def trim_joins(self, target, joins, path):
the join.
"""
for info in reversed(path):
- direct = info.join_field == info.from_field
- if info.to_field == target and direct:
+ if info.to_field == target and info.direct:
target = info.from_field
self.unref_alias(joins.pop())
else:

0 comments on commit 807eff7

Please sign in to comment.
Something went wrong with that request. Please try again.