Ver Fonte

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

Jeremy Stretch há 2 anos atrás
pai
commit
c7dd4206c8
1 ficheiros alterados com 1 adições e 1 exclusões
  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