diff options
| author | Tim Graham <timograham@gmail.com> | 2013-05-27 12:31:49 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-05-27 13:29:53 -0400 |
| commit | 0268aba96bf91de3d172cd6ce2e44c3ce33ef7a0 (patch) | |
| tree | 7afc83960b5e96e1ace08653d3a13d6fca07c866 /django | |
| parent | d194714c0a707773bd470bffb3d67a60e40bb787 (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.py | 4 |
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 |
