Opened 14 years ago

Closed 14 years ago

#14323 closed (duplicate)

ModelChoiceField does not catch ValueErrors in to_python()

Reported by: Mike C. Fletcher Owned by: nobody
Component: Core (Other) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you have an integer field reference (common) and a user passes a non-integer-coercible data-value such as 'w' (admittedly somewhat uncommon) you get a ValueError raised from the depths of the ORM when the QuerySet is queried.

Should catch ValueErrors and raise ValidationErrors to properly report errors.

Change History (1)

comment:1 by Karen Tracey, 14 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #11716

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