mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-26 18:38:38 -06:00
Handle case where trace is no longer connected (#4812 example 3)
This commit is contained in:
parent
15c39340c4
commit
3908b905e5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user