From 459c4bfd9d84fb7f0663f2eaa9f1c9c29dc7b804 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 22 Apr 2025 09:21:14 -0400 Subject: [PATCH 1/2] Fixes #18959: Preserve ordering of terminations in cable traces --- netbox/dcim/svg/cables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 58fa27c6b..2e9c054b9 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -226,7 +226,7 @@ class CableTraceSVG: nodes_height = 0 nodes = [] # Sort them by name to make renders more readable - for i, term in enumerate(sorted(terminations, key=lambda x: str(x))): + for i, term in enumerate(terminations): node = Node( position=(offset_x + i * width, self.cursor), width=width, From 8567aa96e479174a71317e3cd0132c19ba035e49 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 22 Apr 2025 09:42:17 -0400 Subject: [PATCH 2/2] Remove obsolete comment --- netbox/dcim/svg/cables.py | 1 - 1 file changed, 1 deletion(-) diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 2e9c054b9..31ec06100 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -225,7 +225,6 @@ class CableTraceSVG: """ nodes_height = 0 nodes = [] - # Sort them by name to make renders more readable for i, term in enumerate(terminations): node = Node( position=(offset_x + i * width, self.cursor),