Django

Code

Ticket #4067 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Validation of IPAddressField don't work with newforms

Reported by: heine.andersen@gmail.com Assigned to: nobody
Milestone: Component: Forms
Version: 0.96 Keywords: Validate, sprintsept14
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

4067.patch (0.6 kB) - added by Collin Grady <cgrady@the-magi.us> on 04/24/07 22:48:35.
4067.2.patch (4.4 kB) - added by niels on 09/14/07 16:43:22.
Newforms IPAddressField
4067.3.patch (4.6 kB) - added by niels on 09/14/07 18:29:31.
Improved tests

Change History

04/18/07 05:04:24 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

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

04/24/07 22:48:35 changed by Collin Grady <cgrady@the-magi.us>

  • attachment 4067.patch added.

04/24/07 22:49:03 changed by Collin Grady <cgrady@the-magi.us>

  • has_patch set to 1.

09/14/07 14:24:58 changed by chrj

We are looking into this as the Copenhagen sprint.

09/14/07 16:43:22 changed by niels

  • attachment 4067.2.patch added.

Newforms IPAddressField

09/14/07 16:48:06 changed 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.

09/14/07 18:29:31 changed by niels

  • attachment 4067.3.patch added.

Improved tests

09/14/07 19:08:00 changed by SmileyChris

  • stage changed from Accepted to Ready for checkin.

09/15/07 04:12:59 changed by niels

  • keywords changed from Validate to Validate, sprintsept14.

Added sprintsept14 keyword.

09/16/07 06:38:32 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4067 (Validation of IPAddressField don't work with newforms)




Change Properties
Action