web/formfields.py
branchstable
changeset 2347 66d04a868313
parent 2344 22b5ea0679ed
child 2348 acf4b6a59558
--- a/web/formfields.py	Thu Jul 09 12:23:12 2009 +0200
+++ b/web/formfields.py	Thu Jul 09 12:38:33 2009 +0200
@@ -203,10 +203,8 @@
                 widget = Select()
             elif self.max_length and self.max_length < 257:
                 widget = TextInput()
-                maxlength = self.max_length or 45
-                widget.attrs.setdefault('size', min(45, maxlength))
-                if self.max_length:
-                    widget.attrs.setdefault('maxlength', self.max_length)
+                widget.attrs.setdefault('size', min(45, self.max_length))
+                widget.attrs.setdefault('maxlength', self.max_length)
 
         super(StringField, self).init_widget(widget)
         if isinstance(self.widget, TextArea):