summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 6836337429..6037ae8842 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1076,14 +1076,9 @@ class Query(object):
# exclude the "foo__in=[]" case from this handling, because
# it's short-circuited in the Where class.
# We also need to handle the case where a subquery is provided
- entry = self.where_class()
- entry.add((
- Constraint(alias, col, None, eliminatable_if=lambda connection: not getattr(connection.features, "sql_nulls", True)),
- 'isnull',
- True
- ), AND)
- entry.negate()
- self.where.add(entry, AND)
+ self.where.add(
+ (Constraint(alias, col, None, eliminatable_if=lambda connection: not getattr(connection.features, "sql_nulls", True)), 'isnull', False), AND
+ )
if can_reuse is not None:
can_reuse.update(join_list)