summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 9e67e9a993..cbbbee20ba 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1050,6 +1050,10 @@ class Query(object):
raise ValueError("Cannot use None as a query value")
lookup_type = 'isnull'
value = True
+ elif (value == '' and lookup_type == 'exact' and
+ connection.features.interprets_empty_strings_as_nulls):
+ lookup_type = 'isnull'
+ value = True
elif callable(value):
value = value()