Browse Source

Fixes #1845: Correct display of VMs in list with no role assigned

Jeremy Stretch 7 years ago
parent
commit
4e8fc03c2b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netbox/virtualization/tables.py

+ 1 - 1
netbox/virtualization/tables.py

@@ -24,7 +24,7 @@ VIRTUALMACHINE_STATUS = """
 """
 
 VIRTUALMACHINE_ROLE = """
-<label class="label" style="background-color: #{{ record.role.color }}">{{ value }}</label>
+{% if record.role %}<label class="label" style="background-color: #{{ record.role.color }}">{{ value }}</label>{% else %}&mdash;{% endif %}
 """
 
 VIRTUALMACHINE_PRIMARY_IP = """