فهرست منبع

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

Jeremy Stretch 8 ماه پیش
والد
کامیت
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: