Opened 12 years ago
Closed 12 years ago
#20298 closed Uncategorized (duplicate)
Forms - FloatField and IntegerField raise errors when a user enters space in textboxes.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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 -
https://github.com/django/django/pull/1023
I have also attached the patch to this ticket.
Attachments (1)
Change History (2)
by , 12 years ago
Attachment: | fields.patch added |
---|
comment:1 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #18761 (which addresses the real issue, namely that Django's really inconsistent about where it strips and where it won't).
Strips the value before checking for emptiness in case of FloatField and IntegerField