Opened 6 years ago

Closed 6 years ago

#14323 closed (duplicate)

ModelChoiceField does not catch ValueErrors in to_python()

Reported by: mcfletch 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: UI/UX:


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 Changed 6 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #11716

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