Skip to content

Commit c57ab70

Browse files
author
limodou
committed
fix max_length bug
git-svn-id: https://uliweb.googlecode.com/svn/trunk@1009 14287918-b64d-0410-abb6-a92efa0c2026
1 parent a21f426 commit c57ab70

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎uliweb/utils/generic.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ def make_form_field(field, model, field_cls=None, builds_args_map=None):
442442
#add max_length validator
443443
if issubclass(prop.__class__, (orm.StringProperty, orm.CharProperty, orm.UnicodeProperty)):
444444
v = kwargs.setdefault('validators', [])
445-
v.append(IS_LENGTH_LESSTHAN(prop.max_length+1))
445+
if isinstance(prop.max_length, int):
446+
v.append(IS_LENGTH_LESSTHAN(prop.max_length+1))
446447

447448
f = field_type(**kwargs)
448449

0 commit comments

Comments
 (0)