Skip to content

Commit 807eff7

Browse files
committed
Made use of PathInfo.direct flag in trim_joins
Refs django#19385
1 parent 68985db commit 807eff7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

django/db/models/sql/query.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,8 +1445,7 @@ def trim_joins(self, target, joins, path):
14451445
the join.
14461446
"""
14471447
for info in reversed(path):
1448-
direct = info.join_field == info.from_field
1449-
if info.to_field == target and direct:
1448+
if info.to_field == target and info.direct:
14501449
target = info.from_field
14511450
self.unref_alias(joins.pop())
14521451
else:

0 commit comments

Comments
 (0)