summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/query_utils.py')
-rw-r--r--django/db/models/query_utils.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
index 8ac6e008ba..5d0b4e619d 100644
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -89,10 +89,8 @@ class Q(tree.Node):
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
# We must promote any new joins to left outer joins so that when Q is
# used as an expression, rows aren't filtered due to joins.
- joins_before = query.tables[:]
clause, joins = query._add_q(self, reuse, allow_joins=allow_joins, split_subq=False)
- joins_to_promote = [j for j in joins if j not in joins_before]
- query.promote_joins(joins_to_promote)
+ query.promote_joins(joins)
return clause
@classmethod