mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #17601: Record change to terminating object when disconnecting a cable
This commit is contained in:
parent
50df0a1073
commit
85396866bc
@ -366,11 +366,11 @@ class CableTermination(ChangeLoggedModel):
|
|||||||
def delete(self, *args, **kwargs):
|
def delete(self, *args, **kwargs):
|
||||||
|
|
||||||
# Delete the cable association on the terminating object
|
# Delete the cable association on the terminating object
|
||||||
termination_model = self.termination._meta.model
|
termination = self.termination._meta.model.objects.get(pk=self.termination_id)
|
||||||
termination_model.objects.filter(pk=self.termination_id).update(
|
termination.snapshot()
|
||||||
cable=None,
|
termination.cable = None
|
||||||
cable_end=''
|
termination.cable_end = ''
|
||||||
)
|
termination.save()
|
||||||
|
|
||||||
super().delete(*args, **kwargs)
|
super().delete(*args, **kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user