Opened 10 years ago

Closed 9 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: UI/UX:

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@…> 10 years ago.
4067.2.patch (4.4 KB) - added by Niels Sandholt Busch 9 years ago.
Newforms IPAddressField
4067.3.patch (4.6 KB) - added by Niels Sandholt Busch 9 years ago.
Improved tests

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by Chris Beaven

Triage Stage: UnreviewedAccepted

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

Changed 10 years ago by Collin Grady <cgrady@…>

Attachment: 4067.patch added

comment:2 Changed 10 years ago by Collin Grady <cgrady@…>

Has patch: set

comment:3 Changed 9 years ago by chrj

We are looking into this as the Copenhagen sprint.

Changed 9 years ago by Niels Sandholt Busch

Attachment: 4067.2.patch added

Newforms IPAddressField

comment:4 Changed 9 years ago by Niels Sandholt Busch

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.

Changed 9 years ago by Niels Sandholt Busch

Attachment: 4067.3.patch added

Improved tests

comment:5 Changed 9 years ago by Chris Beaven

Triage Stage: AcceptedReady for checkin

comment:6 Changed 9 years ago by Niels Sandholt Busch

Keywords: sprintsept14 added

Added sprintsept14 keyword.

comment:7 Changed 9 years ago by Malcolm Tredinnick

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