#8974: ModelChoiceField raises "ValueError: invalid literal for int() with base
10: 'abc'" when non-numerical value is supplied
------------------------------------+---------------------------------------
Reporter: burp_ | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by Torsten Bronger <[EMAIL PROTECTED]>):
* cc: [EMAIL PROTECTED] (added)
Comment:
I can confirm this. Instead of the !ValueError, a !ValidationError should
be raised. In django/forms/models.py, the try blocks in the clean methods
of !ModelChoiceField and !ModelMultipleChoiceField should also catch
!ValueError exceptions and turn them into !ValidationErrors.
--
Ticket URL: <http://code.djangoproject.com/ticket/8974#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---