From 0268aba96bf91de3d172cd6ce2e44c3ce33ef7a0 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 27 May 2013 12:31:49 -0400 Subject: Fixed #20182 - admin lookup should treat 0 as False for __isnull Thanks Benjie Chen. --- django/contrib/admin/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') 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 -- cgit v1.3