Changes between Initial Version and Version 1 of Ticket #11595, comment 4


Ignore:
Timestamp:
Apr 8, 2011, 6:13:04 PM (13 years ago)
Author:
Łukasz Rekucki

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11595, comment 4

    initial v1  
    11It seems the code is changed since the bug was reported.  Now the code has dictionaries with default_error_messages. Example for lines 865-857:
     2{{{#!python
    23    default_error_messages = {
    34        'invalid': _("This value must be an integer."),
    45    }
     6}}}
    57And in the Exception it has the next, lines 884-890:
    6 
     8{{{#!python
    79    def to_python(self, value):
    810        if value is None:
     
    1214        except (TypeError, ValueError):
    1315            raise exceptions.ValidationError(self.error_messages['invalid'])
    14 
     16}}}
    1517Should we change the code to:
    16 
     18{{{#!python
    1719    default_error_messages = {
    1820        'invalid': _("(%s) must be an integer."),
     
    2628        except (TypeError, ValueError):
    2729            msg = self.error_messages['invalid'] % _(str(value))
    28 
    2930            raise exceptions.ValidationError(msg)
    30 
     31}}}
    3132I am new and that's why I taked an easy_pickings one. But I want to have your ok to prepare my first patch.
    3233   
Back to Top