summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
authorAlex Aktsipetrov <alex.akts@gmail.com>2019-12-05 19:08:47 +0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-06 15:28:23 +0100
commit8af07712df54efbd1d3d9130ab90236f530278c1 (patch)
tree21f6c594dbae105fa6caba330349f5908ec4a1a5 /django/db/models/query_utils.py
parente986e49e66c23c26012749e1a134cba1d6d0bfdd (diff)
[3.0.x] Fixed #31060 -- Reallowed window expressions to be used in conditions outside of queryset filters.
Regression in 4edad1ddf6203326e0be4bdb105beecb0fe454c4. Thanks utapyngo for the report. Backport of bf12273db4e53779546e2ac7b65c0ce8e3c8a640 from master.
Diffstat (limited to 'django/db/models/query_utils.py')
-rw-r--r--django/db/models/query_utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
index 7a667814f4..8e6b9cc9d6 100644
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -90,7 +90,10 @@ 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.
- clause, joins = query._add_q(self, reuse, allow_joins=allow_joins, split_subq=False)
+ clause, joins = query._add_q(
+ self, reuse, allow_joins=allow_joins, split_subq=False,
+ check_filterable=False,
+ )
query.promote_joins(joins)
return clause