id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 17170 django.forms.fields.CharField.widget_attrs wrong return Csaba Tóth nobody "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) }}}" Bug closed Forms 1.3 Normal duplicate Accepted 1 0 0 0 0 0