summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
authorMark Lavin <markdlavin@gmail.com>2015-06-05 10:48:57 -0400
committerTim Graham <timograham@gmail.com>2015-06-05 12:22:43 -0400
commit541f4ea546ad3065852db816769ba6b584e3f373 (patch)
treebfd7489250bc0aab3ccfd0547fdea7ed05231796 /django/db/models/query_utils.py
parentf0450c9b1298bf5f39e229aec76c9bf7d57d4479 (diff)
Fixed #24924 -- Join promotion for multiple Case expressions
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