summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-07 20:50:36 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit396da8b94c62cf955ab401eb40a952b7edba0376 (patch)
treead78e90e36aa104fefa591cddbfb4f831a0f33da /django
parent12ac4916af034221a4e08ce6b5669e53a0223a67 (diff)
Refs #30841 -- Made isnull lookup raise ValueError for non-boolean values.
Per deprecation timeline.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/lookups.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
index 43f40c24ec..916478d075 100644
--- a/django/db/models/lookups.py
+++ b/django/db/models/lookups.py
@@ -1,6 +1,5 @@
import itertools
import math
-import warnings
from copy import copy
from django.core.exceptions import EmptyResultSet
@@ -10,7 +9,6 @@ from django.db.models.fields import (
)
from django.db.models.query_utils import RegisterLookupMixin
from django.utils.datastructures import OrderedSet
-from django.utils.deprecation import RemovedInDjango40Warning
from django.utils.functional import cached_property
from django.utils.hashable import make_hashable
@@ -508,15 +506,9 @@ class IsNull(BuiltinLookup):
def as_sql(self, compiler, connection):
if not isinstance(self.rhs, bool):
- # When the deprecation ends, replace with:
- # raise ValueError(
- # 'The QuerySet value for an isnull lookup must be True or '
- # 'False.'
- # )
- warnings.warn(
- 'Using a non-boolean value for an isnull lookup is '
- 'deprecated, use True or False instead.',
- RemovedInDjango40Warning,
+ raise ValueError(
+ 'The QuerySet value for an isnull lookup must be True or '
+ 'False.'
)
sql, params = compiler.compile(self.lhs)
if self.rhs: