Ticket #3578: 3578_newforms_emailfield_maxlength_fix.diff

File 3578_newforms_emailfield_maxlength_fix.diff, 571 bytes (added by Brian Rosner <brosner@…>, 17 years ago)

patch to fix #3578

  • django/newforms/fields.py

     
    327327        if not self.regex.search(value):
    328328            raise ValidationError(self.error_message)
    329329        return value
     330   
     331    def widget_attrs(self, widget):
     332        if self.max_length:
     333            return {'max_length': str(self.max_length)}
    330334
    331335email_re = re.compile(
    332336    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
Back to Top