#11595: Fixture validation errors should report their data
-------------------------------------+-------------------------------------
               Reporter:  freyley    |        Owner:  raulcd
                   Type:             |       Status:  assigned
  Cleanup/optimization               |    Component:  Core (Serialization)
              Milestone:             |     Severity:  Normal
                Version:  1.0        |     Keywords:  easy-pickings
             Resolution:             |    Has patch:  0
           Triage Stage:  Accepted   |  Needs tests:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------

Comment (by raulcd):

 It seems the code is changed since the bug was reported.  Now the code has
 dictionaries with default_error_messages. Example for lines 865-857:
     default_error_messages = {
         'invalid': _("This value must be an integer."),
     }
 And in the Exception it has the next, lines 884-890:

     def to_python(self, value):
         if value is None:
             return value
         try:
             return int(value)
         except (TypeError, ValueError):
             raise
 exceptions.ValidationError(self.error_messages['invalid'])

 Should we change the code to:

     default_error_messages = {
         'invalid': _("(%s) must be an integer."),
     }

     def to_python(self, value):
         if value is None:
             return value
         try:
             return int(value)
         except (TypeError, ValueError):
             msg = self.error_messages['invalid'] % _(str(value))

             raise exceptions.ValidationError(msg)

 I am new and that's why I taked an easy_pickings one. But I want to have
 your ok to prepare my first patch.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11595#comment:4>
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to