conftypes: handle None for RegexList.
This commit is contained in:
parent
11f1c8f369
commit
a6375a8065
@ -751,10 +751,12 @@ class RegexList(List):
|
|||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
try:
|
try:
|
||||||
self.transform(value)
|
vals = self.transform(value)
|
||||||
except RegexError as e:
|
except RegexError as e:
|
||||||
raise ValidationError(value, "must be a list valid regexes - " +
|
raise ValidationError(value, "must be a list valid regexes - " +
|
||||||
str(e))
|
str(e))
|
||||||
|
if not self.none_ok and None in vals:
|
||||||
|
raise ValidationError(value, "items may not be empty!")
|
||||||
|
|
||||||
|
|
||||||
class File(BaseType):
|
class File(BaseType):
|
||||||
|
Loading…
Reference in New Issue
Block a user