Explorar el Código

Return an empty list if value is None

Jonathan Senecal hace 5 años
padre
commit
d65cead212
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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]