Return an empty list if value is None

This commit is contained in:
Jonathan Senecal 2020-06-05 12:34:09 -04:00
parent e21cbf2a06
commit d65cead212

View File

@ -530,6 +530,8 @@ class ExpandableNameField(forms.CharField):
""" """
def to_python(self, value): def to_python(self, value):
if value is None:
return list()
if re.search(ALPHANUMERIC_EXPANSION_PATTERN, value): if re.search(ALPHANUMERIC_EXPANSION_PATTERN, value):
return list(expand_alphanumeric_pattern(value)) return list(expand_alphanumeric_pattern(value))
return [value] return [value]