1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #10201: Fix AssertionError exception when removing some terminations from an existing cable

This commit is contained in:
jeremystretch
2023-01-11 14:42:25 -05:00
parent 1e54eee631
commit 758c5347fb
3 changed files with 45 additions and 0 deletions

View File

@ -124,6 +124,9 @@ def nullify_connected_endpoints(instance, **kwargs):
model.objects.filter(pk=instance.termination_id).update(cable=None, cable_end='')
for cablepath in CablePath.objects.filter(_nodes__contains=instance.cable):
# Remove the deleted CableTermination if it's one of the path's originating nodes
if instance.termination in cablepath.origins:
cablepath.origins.remove(instance.termination)
cablepath.retrace()