diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-31 10:18:59 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-12-31 10:18:59 +0100 |
| commit | d11038acb2ea2f59a1d00a41b553f578b5f2c59c (patch) | |
| tree | 4958a52483e1dd25bbb9869c7a7dbeec45dd75e7 /django | |
| parent | cee40c7d79930ff42bde4730f43e68a624e47b0f (diff) | |
Fixed #19537 -- Made CheckboxInput._has_changed handle 'False' string
Thanks dibrovsd@gmail.com for the report.
Diffstat (limited to 'django')
| -rw-r--r-- | django/forms/widgets.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index c761ea857d..4782b99117 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -533,6 +533,9 @@ class CheckboxInput(Widget): def _has_changed(self, initial, data): # Sometimes data or initial could be None or '' which should be the # same thing as False. + if initial == 'False': + # show_hidden_initial may have transformed False to 'False' + initial = False return bool(initial) != bool(data) class Select(Widget): |
