1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #28453 -- Made __exact=None lookup use transforms.

This commit is contained in:
Sergey Fedoseev
2017-07-31 01:01:45 +05:00
committed by Tim Graham
parent e3bd328b0f
commit 0baea920c8
3 changed files with 20 additions and 1 deletions

View File

@@ -984,7 +984,8 @@ class Query:
if value is None:
if lookups[-1] not in ('exact', 'iexact'):
raise ValueError("Cannot use None as a query value")
return True, ['isnull'], used_joins
lookups[-1] = 'isnull'
return True, lookups, used_joins
elif hasattr(value, 'resolve_expression'):
pre_joins = self.alias_refcount.copy()
value = value.resolve_expression(self, reuse=can_reuse, allow_joins=allow_joins)