ソースを参照

Fixes #2673: Fix exception on LLDP neighbors view for device with a circuit connected

Jeremy Stretch 7 年 前
コミット
40cb576e11
2 ファイル変更9 行追加1 行削除
  1. 1 0
      CHANGELOG.md
  2. 8 1
      netbox/templates/dcim/device_lldp_neighbors.html

+ 1 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@ v2.5.2 (FUTURE)
 
 ## Bug Fixes
 
+* [#2673](https://github.com/digitalocean/netbox/issues/2673) - Fix exception on LLDP neighbors view for device with a circuit connected
 * [#2691](https://github.com/digitalocean/netbox/issues/2691) - Cable trace should follow circuits
 * [#2698](https://github.com/digitalocean/netbox/issues/2698) - Remove pagination restriction on bulk component creation for devices/VMs
 * [#2707](https://github.com/digitalocean/netbox/issues/2707) - Correct permission evaluation for circuit termination cabling

+ 8 - 1
netbox/templates/dcim/device_lldp_neighbors.html

@@ -22,13 +22,20 @@
                 {% for iface in interfaces %}
                     <tr id="{{ iface.name }}">
                         <td>{{ iface }}</td>
-                        {% if iface.connected_endpoint %}
+                        {% if iface.connected_endpoint.device %}
                             <td class="configured_device" data="{{ iface.connected_endpoint.device }}">
                                 <a href="{% url 'dcim:device' pk=iface.connected_endpoint.device.pk %}">{{ iface.connected_endpoint.device }}</a>
                             </td>
                             <td class="configured_interface" data="{{ iface.connected_endpoint }}">
                                 <span title="{{ iface.connected_endpoint.get_form_factor_display }}">{{ iface.connected_endpoint }}</span>
                             </td>
+                        {% elif iface.connected_endpoint.circuit %}
+                            {% with circuit=iface.connected_endpoint.circuit %}
+                                <td colspan="2">
+                                    <i class="fa fa-fw fa-globe" title="Circuit"></i>
+                                    <a href="{{ circuit.get_absolute_url }}">{{ circuit.provider }} {{ circuit }}</a>
+                                </td>
+                            {% endwith %}
                         {% else %}
                             <td colspan="2">None</td>
                         {% endif %}