summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2019-11-14 23:28:34 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-21 11:56:35 +0100
commit37e6c5b79bd0529a3c85b8c478e4002fd33a2a1d (patch)
tree8381d4425204c73b5078130eb1fbd904942fe130 /django/db/models/sql/query.py
parent306b6875209cfedce2536a6679e69adee7c9bc6a (diff)
Refs #25367 -- Moved conditional expression wrapping to the Exact lookup.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index e6803649e7..f14859fda1 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1222,12 +1222,7 @@ class Query(BaseExpression):
if isinstance(filter_expr, dict):
raise FieldError("Cannot parse keyword query as dict")
if hasattr(filter_expr, 'resolve_expression') and getattr(filter_expr, 'conditional', False):
- if connections[DEFAULT_DB_ALIAS].ops.conditional_expression_supported_in_where_clause(filter_expr):
- condition = filter_expr.resolve_expression(self)
- else:
- # Expression is not supported in the WHERE clause, add
- # comparison with True.
- condition = self.build_lookup(['exact'], filter_expr.resolve_expression(self), True)
+ condition = self.build_lookup(['exact'], filter_expr.resolve_expression(self), True)
clause = self.where_class()
clause.add(condition, AND)
return clause, []