mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Skip signal processing when loading cables from fixtures
This commit is contained in:
parent
2bb79a2773
commit
bd62611117
@ -57,11 +57,14 @@ def clear_virtualchassis_members(instance, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
@receiver(post_save, sender=Cable)
|
@receiver(post_save, sender=Cable)
|
||||||
def update_connected_endpoints(instance, created, **kwargs):
|
def update_connected_endpoints(instance, created, raw=False, **kwargs):
|
||||||
"""
|
"""
|
||||||
When a Cable is saved, check for and update its two connected endpoints
|
When a Cable is saved, check for and update its two connected endpoints
|
||||||
"""
|
"""
|
||||||
logger = logging.getLogger('netbox.dcim.cable')
|
logger = logging.getLogger('netbox.dcim.cable')
|
||||||
|
if raw:
|
||||||
|
logger.debug(f"Skipping endpoint updates for imported cable {instance}")
|
||||||
|
return
|
||||||
|
|
||||||
# Cache the Cable on its two termination points
|
# Cache the Cable on its two termination points
|
||||||
if instance.termination_a.cable != instance:
|
if instance.termination_a.cable != instance:
|
||||||
|
Loading…
Reference in New Issue
Block a user