Explorar o código

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

Jeremy Stretch %!s(int64=8) %!d(string=hai) anos
pai
achega
4e8fc03c2b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 = """