Skip to content

Commit

Permalink
Handle case where trace is no longer connected (#4812 example 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
steffann committed Aug 21, 2020
1 parent 15c3934 commit 3908b90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions netbox/dcim/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ def update_connected_endpoints(instance, **kwargs):
endpoint_b.connected_endpoint = endpoint_a
endpoint_b.connection_status = path_status
endpoint_b.save()
elif endpoint_b is None:
# There is no endpoint, so clean up any left overs
endpoint_a.connected_endpoint = None
endpoint_a.connection_status = path_status
endpoint_a.save()


@receiver(pre_delete, sender=Cable)
Expand Down

0 comments on commit 3908b90

Please sign in to comment.