diff --git a/VERSION b/VERSION index b6401a53..9fb533af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-28 02:08:47) dev +Version 2.00.0 (2012-07-28 02:24:05) dev diff --git a/gluon/validators.py b/gluon/validators.py index a18099fb..0790f9b3 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -264,11 +264,13 @@ class IS_LENGTH(Validator): def __call__(self, value): if isinstance(value, cgi.FieldStorage): - if value.file: + if not value: + length = 0 + elif value.file: value.file.seek(0, os.SEEK_END) length = value.file.tell() value.file.seek(0, os.SEEK_SET) - else: + elif hasattr(value,'value'): val = value.value if val: length = len(val)