#17170: django.forms.fields.CharField.widget_attrs wrong return
----------------------------+--------------------
     Reporter:  tsabi       |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Forms       |    Version:  1.3
     Severity:  Normal      |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  1
Easy pickings:  0           |      UI/UX:  0
----------------------------+--------------------
 The "django.forms.fields.CharField" objects method widget_attrs haven't
 got enough return, it should return with empty dict if the if runs to
 false. But i think the best if it calls the super class' method, which is
 yet returns an empty dict (django.forms.fields.Field)

 {{{#!python
     def widget_attrs(self, widget):
         if self.max_length is not None and isinstance(widget, (TextInput,
 PasswordInput)):
             # The HTML attribute is maxlength, not max_length.
             return {'maxlength': str(self.max_length)}
 +       else:
 +           return Field.widget_attrs(self, widget)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17170>
Django <https://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.

Reply via email to