Skip to content

Commit

Permalink
Fixes #17601: Record change to terminating object when disconnecting …
Browse files Browse the repository at this point in the history
…a cable
  • Loading branch information
jeremystretch committed Sep 25, 2024
1 parent 50df0a1 commit 8539686
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions netbox/dcim/models/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ def save(self, *args, **kwargs):
def delete(self, *args, **kwargs):

# Delete the cable association on the terminating object
termination_model = self.termination._meta.model
termination_model.objects.filter(pk=self.termination_id).update(
cable=None,
cable_end=''
)
termination = self.termination._meta.model.objects.get(pk=self.termination_id)
termination.snapshot()
termination.cable = None
termination.cable_end = ''
termination.save()

super().delete(*args, **kwargs)

Expand Down

0 comments on commit 8539686

Please sign in to comment.