Skip to content

Commit

Permalink
Check far_ends rather than altering draw_far_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
bctiemann committed Dec 17, 2024
1 parent e22d03a commit 129532b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions netbox/dcim/svg/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ def draw_far_objects(self, obj_list, terminations):
"""
Draw the far-end objects and its terminations and return all created nodes
"""
# If an empty list is passed in, return empty results so this cable can be skipped
if not len(obj_list):
return [], []

# Make sure elements are sorted by name for readability
objects = sorted(obj_list, key=lambda x: str(x))
width = self.width / len(objects)
Expand Down Expand Up @@ -366,15 +362,10 @@ def render(self):
self.cursor += CABLE_HEIGHT

# Connector (a Cable or WirelessLink)
if links:
if links and far_ends:

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

0 comments on commit 129532b

Please sign in to comment.