Opened 4 years ago
Last modified 4 years ago
#32347 closed New feature
ModelChoiceField does not provide value of invalid choice when raising ValidationError — at Initial Version
Reported by: | Aaron Wiegel | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 4.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Compared with ChoiceField
and others, ModelChoiceField
does not show the value of the invalid choice when raising a validation error. Passing in parameters with the invalid value and modifying the default error message for the code invalid_choice
should fix this.
Note:
See TracTickets
for help on using tickets.