oops stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 09 Jul 2009 12:38:33 +0200
branchstable
changeset 2347 66d04a868313
parent 2346 d0026f2c6a81
child 2348 acf4b6a59558
oops
web/formfields.py
--- 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):