Code

Opened 7 years ago

Closed 7 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@…> 7 years ago.
4067.2.patch (4.4 KB) - added by niels 7 years ago.
Newforms IPAddressField
4067.3.patch (4.6 KB) - added by niels 7 years ago.
Improved tests

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

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

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

  • Has patch set

comment:3 Changed 7 years ago by chrj

We are looking into this as the Copenhagen sprint.

Changed 7 years ago by niels

Newforms IPAddressField

comment:4 Changed 7 years ago by niels

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 7 years ago by niels

Improved tests

comment:5 Changed 7 years ago by SmileyChris

  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 7 years ago by niels

  • Keywords Validate, sprintsept14 added; Validate removed

Added sprintsept14 keyword.

comment:7 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.