mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 12:06:53 -06:00
Return an empty list if value is None
This commit is contained in:
parent
e21cbf2a06
commit
d65cead212
@ -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]
|
||||||
|
Loading…
Reference in New Issue
Block a user