web/formfields.py
branchtls-sprint
changeset 1803 abf40bcb5967
parent 1793 fdac26e003e7
child 1836 d3f0c6e868ef
--- a/web/formfields.py	Thu May 14 11:38:40 2009 +0200
+++ b/web/formfields.py	Thu May 14 12:31:23 2009 +0200
@@ -473,9 +473,10 @@
                     if card in '?1':
                         kwargs['widget'].attrs.setdefault('size', 1)
                 if isinstance(cstr, SizeConstraint) and cstr.max is not None:
-                    if cstr.max > 257:
-                        kwargs.setdefault('widget', TextArea)
+                    if cstr.max < 257:
+                        kwargs.setdefault('widget', TextInput())
                     kwargs['max_length'] = cstr.max
+            kwargs.setdefault('widget', TextArea())
             return StringField(**kwargs)
         if fieldclass is FileField:
             for metadata in ('format', 'encoding'):