fixed IS_LENGTH

This commit is contained in:
mdipierro
2012-07-28 02:24:09 -05:00
parent 498774d47e
commit be93995a3b
2 changed files with 5 additions and 3 deletions

View File

@@ -1 +1 @@
Version 2.00.0 (2012-07-28 02:08:47) dev
Version 2.00.0 (2012-07-28 02:24:05) dev

View File

@@ -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)