Skip to content

Commit

Permalink
Move continue statement to right after draw_far_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
bctiemann committed Dec 17, 2024
1 parent 2c2815e commit 25b5d70
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions netbox/dcim/svg/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ def render(self):

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 = [
Expand Down Expand Up @@ -409,10 +414,6 @@ def render(self):
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
Expand Down

0 comments on commit 25b5d70

Please sign in to comment.