summaryrefslogtreecommitdiff
path: root/django/contrib/admin/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/admin/utils.py')
-rw-r--r--django/contrib/admin/utils.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/contrib/admin/utils.py b/django/contrib/admin/utils.py
index 545954af54..1b1cff7ec8 100644
--- a/django/contrib/admin/utils.py
+++ b/django/contrib/admin/utils.py
@@ -53,11 +53,8 @@ def prepare_lookup_value(key, value):
if key.endswith('__in'):
value = value.split(',')
# if key ends with __isnull, special case '' and the string literals 'false' and '0'
- if key.endswith('__isnull'):
- if value.lower() in ('', 'false', '0'):
- value = False
- else:
- value = True
+ elif key.endswith('__isnull'):
+ value = value.lower() not in ('', 'false', '0')
return value