mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 13:06:30 -06:00
Fix signal logic
This commit is contained in:
parent
36cf40f25c
commit
e2398c8c0e
@ -13,9 +13,10 @@ def assign_virtualchassis_master(instance, created, **kwargs):
|
|||||||
When a VirtualChassis is created, automatically assign its master device (if any) to the VC.
|
When a VirtualChassis is created, automatically assign its master device (if any) to the VC.
|
||||||
"""
|
"""
|
||||||
if created and instance.master:
|
if created and instance.master:
|
||||||
instance.master.virtual_chassis = instance
|
master = Device.objects.get(pk=instance.master.pk)
|
||||||
instance.master.vc_position = 1
|
master.virtual_chassis = instance
|
||||||
instance.master.save()
|
master.vc_position = 1
|
||||||
|
master.save()
|
||||||
|
|
||||||
|
|
||||||
@receiver(pre_delete, sender=VirtualChassis)
|
@receiver(pre_delete, sender=VirtualChassis)
|
||||||
|
Loading…
Reference in New Issue
Block a user