Explorar o código

Fixes #13727: Fix exception when viewing rendered config for VM without a role assigned

Jeremy Stretch %!s(int64=2) %!d(string=hai) anos
pai
achega
c7dd4206c8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/dcim/models/mixins.py

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

@@ -69,7 +69,7 @@ class RenderConfigMixin(models.Model):
         """
         if self.config_template:
             return self.config_template
-        if self.role.config_template:
+        if self.role and self.role.config_template:
             return self.role.config_template
         if self.platform and self.platform.config_template:
             return self.platform.config_template