improved coverage, fix bug with IS_LIST_OF and items not being strings

This commit is contained in:
niphlod
2014-09-19 00:15:25 +02:00
parent 424746ce7a
commit 8bbd22eba8
2 changed files with 145 additions and 4 deletions
+1 -4
View File
@@ -1168,11 +1168,8 @@ class IS_LIST_OF_EMAILS(object):
def __call__(self, value):
bad_emails = []
emails = []
f = IS_EMAIL()
for email in self.split_emails.findall(value):
if not email in emails:
emails.append(email)
error = f(email)[1]
if error and not email in bad_emails:
bad_emails.append(email)
@@ -2520,7 +2517,7 @@ class IS_LIST_OF(Validator):
if not isinstance(other, (list,tuple)):
other = [other]
for item in ivalue:
if item.strip():
if str(item).strip():
v = item
for validator in other:
(v, e) = validator(v)