diff --git a/docs/customization/reports.md b/docs/customization/reports.md index 150c32f40..ab2f1f81b 100644 --- a/docs/customization/reports.md +++ b/docs/customization/reports.md @@ -45,7 +45,7 @@ class DeviceConnectionsReport(Report): # Check that every console port for every active device has a connection defined. active = DeviceStatusChoices.STATUS_ACTIVE for console_port in ConsolePort.objects.prefetch_related('device').filter(device__status=active): - if console_port.connected_endpoint is None: + if not console_port.connected_endpoints: self.log_failure( console_port.device, "No console connection defined for {}".format(console_port.name) @@ -64,7 +64,7 @@ class DeviceConnectionsReport(Report): for device in Device.objects.filter(status=DeviceStatusChoices.STATUS_ACTIVE): connected_ports = 0 for power_port in PowerPort.objects.filter(device=device): - if power_port.connected_endpoint is not None: + if power_port.connected_endpoints: connected_ports += 1 if not power_port.path.is_active: self.log_warning( diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index 8f1285901..ce768e439 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -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', diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 887433d7b..49078c8db 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -210,7 +210,7 @@
{{ powerfeed|linkify }} | {% badge powerfeed.get_status_display bg_color=powerfeed.get_status_color %} | {% badge powerfeed.get_type_display bg_color=powerfeed.get_type_color %} | - {% with power_port=powerfeed.connected_endpoint %} + {% with power_port=powerfeed.connected_endpoints.0 %} {% if power_port %}{% utilization_graph power_port.get_power_draw.allocated|percentage:powerfeed.available_power %} | {% else %}