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:
committed by
Tim Graham
parent
2fd7fc134c
commit
d4e578d0f6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user