summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-05-27 12:31:49 -0400
committerTim Graham <timograham@gmail.com>2013-05-27 13:29:53 -0400
commit0268aba96bf91de3d172cd6ce2e44c3ce33ef7a0 (patch)
tree7afc83960b5e96e1ace08653d3a13d6fca07c866 /django
parentd194714c0a707773bd470bffb3d67a60e40bb787 (diff)
Fixed #20182 - admin lookup should treat 0 as False for __isnull
Thanks Benjie Chen.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/admin/util.py b/django/contrib/admin/util.py
index 078adbe827..a53cd367b4 100644
--- a/django/contrib/admin/util.py
+++ b/django/contrib/admin/util.py
@@ -37,9 +37,9 @@ def prepare_lookup_value(key, value):
# if key ends with __in, split parameter into separate values
if key.endswith('__in'):
value = value.split(',')
- # if key ends with __isnull, special case '' and false
+ # if key ends with __isnull, special case '' and the string literals 'false' and '0'
if key.endswith('__isnull'):
- if value.lower() in ('', 'false'):
+ if value.lower() in ('', 'false', '0'):
value = False
else:
value = True