mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-17 06:29:53 +02:00
Compare commits
9 Commits
main
...
post-raw-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da4fb4b1cd | ||
|
|
959d36cafc | ||
|
|
fb417912a5 | ||
|
|
8e4588bbca | ||
|
|
58eb42a424 | ||
|
|
7b9ab87e38 | ||
|
|
90255a268f | ||
|
|
8418809344 | ||
|
|
b39e1c73c1 |
@@ -166,6 +166,20 @@ def retrace_cable_paths(instance, **kwargs):
|
|||||||
cablepath.retrace()
|
cablepath.retrace()
|
||||||
|
|
||||||
|
|
||||||
|
@receiver(post_save, sender=Cable)
|
||||||
|
def retrace_cable_paths_on_raw_create(sender, instance, raw=False, **kwargs):
|
||||||
|
"""
|
||||||
|
Trigger cable path retracing for a Cable instance when dependencies need to be
|
||||||
|
recalculated. Callers should fire post_save with post_raw_create=True after
|
||||||
|
all CableTerminations are in place.
|
||||||
|
"""
|
||||||
|
post_raw_create = kwargs.get('post_raw_create', False)
|
||||||
|
if not post_raw_create:
|
||||||
|
return
|
||||||
|
instance._terminations_modified = True
|
||||||
|
trace_paths.send(Cable, instance=instance, created=True)
|
||||||
|
|
||||||
|
|
||||||
@receiver((post_delete, post_save), sender=PortMapping)
|
@receiver((post_delete, post_save), sender=PortMapping)
|
||||||
def update_passthrough_port_paths(instance, **kwargs):
|
def update_passthrough_port_paths(instance, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user