Strip fields' values consistently
|Reported by:||vzima||Owned by:||deni|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently, some fields strips values during validation and some do not. The state does not even clearly represents whether whitespace is valid part of field's value.
- Spaces are not allowed in URLField, IPAddressField, GenericIPAddressField and SlugField
- Fairly unclear are boolean fields. IMHO if value to validate is string of whitespace characters, it should validate to None/False as when represented by TextInput user will see empty field.
I have not check localised form fields but I expect more fields that can be safely trimmed.
Maybe a good long-term solution would be list of filters (like validators) which would perform transformation to python object.
Change History (11)
comment:1 Changed 3 years ago by melinath
- Easy pickings set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted