mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #13770 -- Extended BooleanField form field to also clean u'false' to False. Thanks, jordanb and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -605,7 +605,7 @@ class BooleanField(Field):
|
||||
# will submit for False. Also check for '0', since this is what
|
||||
# RadioSelect will provide. Because bool("True") == bool('1') == True,
|
||||
# we don't need to handle that explicitly.
|
||||
if value in ('False', '0'):
|
||||
if isinstance(value, basestring) and value.lower() in ('false', '0'):
|
||||
value = False
|
||||
else:
|
||||
value = bool(value)
|
||||
|
||||
Reference in New Issue
Block a user