فهرست منبع

Return an empty list if value is None

Jonathan Senecal 5 سال پیش
والد
کامیت
d65cead212
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  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]