Opened 18 years ago

Closed 17 years ago

#4067 closed (fixed)

Validation of IPAddressField don't work with newforms

Reported by: heine.andersen@… 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)

4067.patch (664 bytes ) - added by Collin Grady <cgrady@…> 18 years ago.
4067.2.patch (4.4 KB ) - added by Niels Sandholt Busch 17 years ago.
Newforms IPAddressField
4067.3.patch (4.6 KB ) - added by Niels Sandholt Busch 17 years ago.
Improved tests

Download all attachments as: .zip

Change History (10)

comment:1 by Chris Beaven, 18 years ago

Triage Stage: UnreviewedAccepted

Correct, either we need a newforms.fields.IPAddressField or alternately its formfield method should return a helpful RegexField

by Collin Grady <cgrady@…>, 18 years ago

Attachment: 4067.patch added

comment:2 by Collin Grady <cgrady@…>, 18 years ago

Has patch: set

comment:3 by chrj, 17 years ago

We are looking into this as the Copenhagen sprint.

by Niels Sandholt Busch, 17 years ago

Attachment: 4067.2.patch added

Newforms IPAddressField

comment:4 by Niels Sandholt Busch, 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.

by Niels Sandholt Busch, 17 years ago

Attachment: 4067.3.patch added

Improved tests

comment:5 by Chris Beaven, 17 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Niels Sandholt Busch, 17 years ago

Keywords: sprintsept14 added

Added sprintsept14 keyword.

comment:7 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [6357]) Fixed #4067 -- Fixed validation of IPAddressFields in newforms. Thanks to neils and the team in the Copenhagen sprint group.

Note: See TracTickets for help on using tickets.
Back to Top