Opened 18 years ago
Closed 17 years ago
#4067 closed (fixed)
Validation of IPAddressField don't work with newforms
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | 0.96 |
Severity: | Keywords: | Validate, sprintsept14 | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a enter an illegal ip address, like 1.2.3.4.5, then form.is_valid() is still True.
ProgrammingError at /sshmanager/add_update_entry/
invalid input syntax for type inet: "1.2.3.4.5"
Request Method: POST
Request URL: http://127.0.0.1:8000/sshmanager/add_update_entry/
Exception Type: ProgrammingError
Exception Value: invalid input syntax for type inet: "1.2.3.4.5"
Exception Location: /usr/lib/python2.5/site-packages/django/db/backends/util.py in execute, line 12
Attachments (3)
Change History (10)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 18 years ago
Attachment: | 4067.patch added |
---|
comment:2 by , 18 years ago
Has patch: | set |
---|
comment:4 by , 17 years ago
We have implemented a new patch for this ticket. We believe IPAddressField should have it's own abstraction in newforms as well as URLField, EmailField and friends.
The patch contains the implementation, doctests as well as documentation in newforms.txt.
comment:5 by , 17 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:7 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Correct, either we need a
newforms.fields.IPAddressField
or alternately itsformfield
method should return a helpfulRegexField