From 3c8e7e739d2fe4cbb7729a91d49e95f8b09c20b1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 15 May 2020 09:44:00 -0400 Subject: [PATCH] Fixes #4649: Fix interface assignment for bulk-imported IP addresses --- docs/release-notes/version-2.8.md | 1 + netbox/ipam/forms.py | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/release-notes/version-2.8.md b/docs/release-notes/version-2.8.md index 6d1907eb0..60adf53cc 100644 --- a/docs/release-notes/version-2.8.md +++ b/docs/release-notes/version-2.8.md @@ -9,6 +9,7 @@ v2.8.5 (FUTURE) * [#4646](https://github.com/netbox-community/netbox/issues/4646) - Correct UI link for reports with custom name * [#4647](https://github.com/netbox-community/netbox/issues/4647) - Fix caching invalidation issue related to assigning new IP addresses to interfaces * [#4648](https://github.com/netbox-community/netbox/issues/4648) - Fix bulk CSV import of child devices +* [#4649](https://github.com/netbox-community/netbox/issues/4649) - Fix interface assignment for bulk-imported IP addresses --- diff --git a/netbox/ipam/forms.py b/netbox/ipam/forms.py index 5906e19a4..fc1352ec9 100644 --- a/netbox/ipam/forms.py +++ b/netbox/ipam/forms.py @@ -780,18 +780,6 @@ class IPAddressCSVForm(CustomFieldModelCSVForm): def save(self, *args, **kwargs): - # Set interface - if self.cleaned_data['device'] and self.cleaned_data['interface_name']: - self.instance.interface = Interface.objects.get( - device=self.cleaned_data['device'], - name=self.cleaned_data['interface_name'] - ) - elif self.cleaned_data['virtual_machine'] and self.cleaned_data['interface_name']: - self.instance.interface = Interface.objects.get( - virtual_machine=self.cleaned_data['virtual_machine'], - name=self.cleaned_data['interface_name'] - ) - ipaddress = super().save(*args, **kwargs) # Set as primary for device/VM