Browse Source

Fixed prefix/VLAN role links

Jeremy Stretch 8 years ago
parent
commit
f0d8e02d63
1 changed files with 10 additions and 2 deletions
  1. 10 2
      netbox/ipam/tables.py

+ 10 - 2
netbox/ipam/tables.py

@@ -59,7 +59,11 @@ PREFIX_LINK_BRIEF = """
 """
 
 PREFIX_ROLE_LINK = """
-<a href="{% url 'ipam:prefix_list' %}?role={{ record.role.slug }}">{{ record.role }}</a>
+{% if record.role %}
+    <a href="{% url 'ipam:prefix_list' %}?role={{ record.role.slug }}">{{ record.role }}</a>
+{% else %}
+    &mdash;
+{% endif %}
 """
 
 IPADDRESS_LINK = """
@@ -99,7 +103,11 @@ VLAN_PREFIXES = """
 """
 
 VLAN_ROLE_LINK = """
-<a href="{% url 'ipam:vlan_list' %}?role={{ record.role.slug }}">{{ record.role }}</a>
+{% if record.role %}
+    <a href="{% url 'ipam:vlan_list' %}?role={{ record.role.slug }}">{{ record.role }}</a>
+{% else %}
+    &mdash;
+{% endif %}
 """
 
 VLANGROUP_ACTIONS = """