Return an empty list if value is None

This commit is contained in:
Jonathan Senecal 2020-06-05 12:34:09 -04:00
parent 87dd31f3cd
commit 73d6c7de43

View File

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