conftypes: handle None for RegexList.

This commit is contained in:
Florian Bruhin 2014-08-05 18:02:31 +02:00
parent 11f1c8f369
commit a6375a8065

View File

@ -751,10 +751,12 @@ class RegexList(List):
def validate(self, value):
try:
self.transform(value)
vals = self.transform(value)
except RegexError as e:
raise ValidationError(value, "must be a list valid regexes - " +
str(e))
if not self.none_ok and None in vals:
raise ValidationError(value, "items may not be empty!")
class File(BaseType):