1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

fixes prechange snapshot #12617

This commit is contained in:
Abhimanyu Saharan
2023-06-24 00:29:37 +05:30
committed by Jeremy Stretch
parent 860be780ad
commit 16ee42ac38

View File

@ -379,6 +379,7 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
interface = self.instance.assigned_object
if type(interface) in (Interface, VMInterface):
parent = interface.parent_object
parent.snapshot()
if self.cleaned_data['primary_for_parent']:
if ipaddress.address.version == 4:
parent.primary_ip4 = ipaddress