Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3281 closed defect (fixed)

[patch] newforms.URLField() does not validate with both required=False and verify_exists=True

Reported by: zendak Owned by: adrian
Component: Forms Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The following newforms field will prevent its form from validating if given a "False" value (empty string or None):

url = newforms.URLField(required=False, verify_exists=True)

This combination of required and verify_exists causes a conflict. Note that for a corresponding model.URLField(blank=True, verify_exists=True) there is no such conflict when accessed through the Admin.

Attachments (1)

fields.diff (470 bytes) - added by astrec 8 years ago.
replacement patch - non-relative header, and .diff extension

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by anonymous

  • Summary changed from newforms.URLField() does not validate with both required=False and verify_exists=True to [patch] newforms.URLField() does not validate with both required=False and verify_exists=True

Changed 8 years ago by astrec

replacement patch - non-relative header, and .diff extension

comment:2 Changed 8 years ago by adrian

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

(In [4313]) Fixed #3281 -- newforms: URLField now works properly with required=False and verify_exists=True together. Thanks, zendak

comment:3 Changed 8 years ago by zendak

Thanks for the patch, astrec, you beat me to it. Works perfectly now.

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