Parcourir la source

Return an empty list if value is None

Jonathan Senecal il y a 5 ans
Parent
commit
d65cead212
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      netbox/utilities/forms.py

+ 2 - 0
netbox/utilities/forms.py

@@ -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]