瀏覽代碼

Fixes #19667: Fix TypeError exception when creating a new module profile type with no schema (#19671)

Jeremy Stretch 11 月之前
父節點
當前提交
43df06f210
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netbox/dcim/models/modules.py

+ 1 - 1
netbox/dcim/models/modules.py

@@ -144,7 +144,7 @@ class ModuleType(ImageAttachmentsMixin, PrimaryModel, WeightMixin):
         super().clean()
 
         # Validate any attributes against the assigned profile's schema
-        if self.profile:
+        if self.profile and self.profile.schema:
             try:
                 jsonschema.validate(self.attribute_data, schema=self.profile.schema)
             except JSONValidationError as e: