Skip to content

Commit 38172b7

Browse files
committed
Fixes #7294: Fix SVG rendering for cable traces ending at unoccupied front ports
1 parent 6bccb6d commit 38172b7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/release-notes/version-3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
### Bug Fixes
1111

12+
* [#7294](https://github.com/netbox-community/netbox/issues/7294) - Fix SVG rendering for cable traces ending at unoccupied front ports
1213
* [#7321](https://github.com/netbox-community/netbox/issues/7321) - Don't overwrite multi-select custom fields during bulk edit
1314
* [#7324](https://github.com/netbox-community/netbox/issues/7324) - Fix TypeError exception in web UI when filtering objects using single-choice filters
1415
* [#7333](https://github.com/netbox-community/netbox/issues/7333) - Prevent inadvertent deletion of prior change records when deleting objects

netbox/dcim/models/device_components.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ def trace(self):
185185

186186
# Construct the complete path
187187
path = [self, *self._path.get_path()]
188-
if self._path.destination:
189-
path.append(self._path.destination)
190-
while len(path) % 3:
191-
# Pad to ensure we have complete three-tuples (e.g. for paths that end at a RearPort)
192-
path.insert(-1, None)
188+
while (len(path) + 1) % 3:
189+
# Pad to ensure we have complete three-tuples (e.g. for paths that end at a non-connected FrontPort)
190+
path.append(None)
191+
path.append(self._path.destination)
193192

194193
# Return the path as a list of three-tuples (A termination, cable, B termination)
195194
return list(zip(*[iter(path)] * 3))

netbox/dcim/svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def render(self):
482482
)
483483
parent_objects.append(parent_object)
484484

485-
else:
485+
elif far_end:
486486

487487
# Attachment
488488
attachment = self._draw_attachment()

0 commit comments

Comments
 (0)