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

Fixes #8127: Fix disassociation of interface under IP address edit view

This commit is contained in:
jeremystretch
2021-12-21 13:17:54 -05:00
parent 373cc74a33
commit 344fb638fd
2 changed files with 4 additions and 1 deletions

View File

@ -471,6 +471,8 @@ class IPAddressForm(TenancyForm, CustomFieldModelForm):
})
elif selected_objects:
self.instance.assigned_object = self.cleaned_data[selected_objects[0]]
else:
self.instance.assigned_object = None
# Primary IP assignment is only available if an interface has been assigned.
interface = self.cleaned_data.get('interface') or self.cleaned_data.get('vminterface')