ModelChoiceField does not catch ValueErrors in to_python()
|Reported by:||Mike C. Fletcher||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.