Fixed #16820 -- Treated '0' value as True for checkbox inputs

Thanks Dan Fairs for the report and the initial patch.
This commit is contained in:
Claude Paroz 2012-10-26 20:44:00 +02:00
parent 90c7656466
commit be29329ccd
3 changed files with 10 additions and 1 deletions

View file

@ -528,7 +528,7 @@ class CheckboxInput(Widget):
values = {'true': True, 'false': False}
if isinstance(value, six.string_types):
value = values.get(value.lower(), value)
return value
return bool(value)
def _has_changed(self, initial, data):
# Sometimes data or initial could be None or '' which should be the