Opened 4 years ago

Closed 4 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.

Attachments (0)

Change History (1)

comment:1 Changed 4 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

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.