From 25b5d70b6dcbfbf33a42565dbb31905049d9cd90 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Mon, 16 Dec 2024 20:00:01 -0500 Subject: [PATCH] Move continue statement to right after draw_far_objects --- netbox/dcim/svg/cables.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 0c308c245..4de30f5cb 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -370,6 +370,11 @@ class CableTraceSVG: obj_list = {end.parent_object for end in far_ends} parent_object_nodes, far_terminations = self.draw_far_objects(obj_list, far_ends) + + # If there are no far terminations, this segment can't be rendered, so skip. + if not far_terminations: + continue + for cable in links: # Fill in labels and description with all available data description = [ @@ -409,10 +414,6 @@ class CableTraceSVG: near = [term for term in near_terminations if term.object == cable.interface_b] far = [term for term in far_terminations if term.object == cable.interface_a] - # If at this point we have no near or no far terminations, this cable can't be rendered, so skip. - if not (near and far): - continue - # Select most-probable start and end position start = near[0].bottom_center end = far[0].top_center