BooleanField should clean the string 'False' to boolean False
|Reported by:||SmileyChris||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently the comment says:
# Explicitly check for the string '0', which is what as hidden field # will submit for False.
But that's just blatantly incorrect, the HiddenInput widget submits the string 'False' for False.
There are a couple of solutions here, I have chosen the first in the initial patch, due to the fact it's in-line with what happens already:
- The BooleanField should clean 'False' to False
- The HiddenInput should render False as ''
- A new HiddenBooleanInput widget should be created and linked to BooleanField.hidden_widget (ugh)
Change History (3)
Changed 7 years ago by SmileyChris
comment:1 Changed 7 years ago by SmileyChris
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Ready for checkin