1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

11048 fix connected_endpoint refs

This commit is contained in:
Arthur
2022-11-29 11:02:35 -08:00
committed by Jeremy Stretch
parent 3bd560add8
commit cf0258204f
4 changed files with 5 additions and 5 deletions

View File

@@ -189,7 +189,7 @@ class PathEndpoint(models.Model):
dcim.signals in response to changes in the cable path, and complements the `origin` GenericForeignKey field on the
CablePath model. `_path` should not be accessed directly; rather, use the `path` property.
`connected_endpoint()` is a convenience method for returning the destination of the associated CablePath, if any.
`connected_endpoints()` is a convenience method for returning the destination of the associated CablePath, if any.
"""
_path = models.ForeignKey(
to='dcim.CablePath',

View File

@@ -210,7 +210,7 @@
<div class="card">
<h5 class="card-header">Wireless</h5>
<div class="card-body">
{% with peer=object.connected_endpoint %}
{% with peer=object.connected_endpoints.0 %}
<table class="table table-hover">
<thead>
<tr>

View File

@@ -173,7 +173,7 @@
<td>{{ powerfeed|linkify }}</td>
<td>{% badge powerfeed.get_status_display bg_color=powerfeed.get_status_color %}</td>
<td>{% badge powerfeed.get_type_display bg_color=powerfeed.get_type_color %}</td>
{% with power_port=powerfeed.connected_endpoint %}
{% with power_port=powerfeed.connected_endpoints.0 %}
{% if power_port %}
<td>{% utilization_graph power_port.get_power_draw.allocated|percentage:powerfeed.available_power %}</td>
{% else %}