Parcourir la source

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

Jeremy Stretch il y a 7 ans
Parent
commit
4e8fc03c2b
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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 = """