Forms - FloatField and IntegerField raise errors when a user enters space in textboxes.
|Reported by:||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When a user keys in few spaces in a FloatField or IntegerField. Django fails to treat them as empty and tries to convert them to float and int respectively, leading to an unnecessary validation error. Users need to define custom fields and custom clean methods currently to overcome this issue.
Stripping the value prior to conversion will solve the problem. I have submitted a pull reqhest here -
I have also attached the patch to this ticket.