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

Fixes #9778: Fix exception during cable deletion after deleting a connected termination

This commit is contained in:
jeremystretch
2022-08-03 12:46:16 -04:00
parent b9678c7c0e
commit 367bf25618
6 changed files with 26 additions and 16 deletions

View File

@@ -24,11 +24,12 @@ def object_to_path_node(obj):
def path_node_to_object(repr):
"""
Given the string representation of a path node, return the corresponding instance.
Given the string representation of a path node, return the corresponding instance. If the object no longer
exists, return None.
"""
ct_id, object_id = decompile_path_node(repr)
ct = ContentType.objects.get_for_id(ct_id)
return ct.model_class().objects.get(pk=object_id)
return ct.model_class().objects.filter(pk=object_id).first()
def create_cablepath(terminations):