mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
#15390 add trace signal if cable terminatiions changed
This commit is contained in:
parent
e8891f770c
commit
5fb81e9943
@ -368,22 +368,23 @@ class CableTermination(ChangeLoggedModel):
|
|||||||
termination.save()
|
termination.save()
|
||||||
|
|
||||||
# figure out which cable terminations changed
|
# figure out which cable terminations changed
|
||||||
update_cable_termination = False
|
|
||||||
update_orig_cable_termination = False
|
|
||||||
if not created:
|
if not created:
|
||||||
|
update_cable_termination = False
|
||||||
|
update_orig_cable_termination = False
|
||||||
|
|
||||||
if self._orig_cable and self._orig_cable != self.cable:
|
if self._orig_cable and self._orig_cable != self.cable:
|
||||||
update_cable_termination = True
|
update_cable_termination = True
|
||||||
update_orig_cable_termination = True
|
update_orig_cable_termination = True
|
||||||
elif self._orig_cable_end and self._orig_cable_end != self.cable_end:
|
elif self._orig_cable_end and self._orig_cable_end != self.cable_end:
|
||||||
update_cable_termination = True
|
update_cable_termination = True
|
||||||
|
|
||||||
if update_cable_termination:
|
if update_cable_termination:
|
||||||
self.cable._terminations_modified = True
|
self.cable._terminations_modified = True
|
||||||
trace_paths.send(Cable, instance=self.cable, created=False)
|
trace_paths.send(Cable, instance=self.cable, created=False)
|
||||||
|
|
||||||
if update_orig_cable_termination:
|
if update_orig_cable_termination:
|
||||||
self._orig_cable._terminations_modified = True
|
self._orig_cable._terminations_modified = True
|
||||||
trace_paths.send(Cable, instance=self._orig_cable, created=False)
|
trace_paths.send(Cable, instance=self._orig_cable, created=False)
|
||||||
|
|
||||||
self._orig_cable_end = self.cable_end
|
self._orig_cable_end = self.cable_end
|
||||||
self._orig_cable = self.cable
|
self._orig_cable = self.cable
|
||||||
|
Loading…
Reference in New Issue
Block a user