Browse Source

Meta.fields should be optional

Jeremy Stretch 6 năm trước cách đây
mục cha
commit
44fd0ebb2d
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      netbox/extras/scripts.py

+ 1 - 1
netbox/extras/scripts.py

@@ -139,7 +139,7 @@ class Script:
         vars = OrderedDict()
 
         # Infer order from Meta.fields (Python 3.5 and lower)
-        fields = getattr(self.Meta, 'fields')
+        fields = getattr(self.Meta, 'fields', [])
         for name in fields:
             vars[name] = getattr(self, name)