mirror of
https://github.com/django/django.git
synced 2025-12-02 00:01:29 +00:00
Fixed #28453 -- Made __exact=None lookup use transforms.
This commit is contained in:
parent
e3bd328b0f
commit
0baea920c8
3 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue