From d4e578d0f64971483ded49f9cae460ea174b5138 Mon Sep 17 00:00:00 2001 From: Denis Moskalets Date: Tue, 3 Dec 2013 13:24:45 +0400 Subject: Fixed #21552 -- Allowed the use of None for the iexact lookup. Thanks Anubhav Joshi for the documentation. --- django/db/models/sql/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 43026d2d82..223e516d56 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1031,7 +1031,7 @@ class Query(object): # Interpret '__exact=None' as the sql 'is NULL'; otherwise, reject all # uses of None as a query value. if value is None: - if lookup_type != 'exact': + if lookup_type not in ('exact', 'iexact'): raise ValueError("Cannot use None as a query value") lookup_type = 'isnull' value = True -- cgit v1.3