Selaa lähdekoodia

Return an empty list if value is None

Jonathan Senecal 6 vuotta sitten
vanhempi
commit
d65cead212
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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]