Просмотр исходного кода

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

Jeremy Stretch 8 месяцев назад
Родитель
Сommit
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: