1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #21552 -- Allowed the use of None for the iexact lookup.

Thanks Anubhav Joshi for the documentation.
This commit is contained in:
Denis Moskalets
2013-12-03 13:24:45 +04:00
committed by Tim Graham
parent 2fd7fc134c
commit d4e578d0f6
4 changed files with 17 additions and 4 deletions

View File

@@ -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