From 1ad029712eacc2bf671c2d4dcdb30d45b5953669 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 25 Apr 2023 14:44:45 -0700 Subject: [PATCH] #11902 validate device on inventory item import --- netbox/dcim/forms/bulk_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/forms/bulk_import.py b/netbox/dcim/forms/bulk_import.py index d29e8e250..af89c35c8 100644 --- a/netbox/dcim/forms/bulk_import.py +++ b/netbox/dcim/forms/bulk_import.py @@ -928,7 +928,7 @@ class InventoryItemImportForm(NetBoxModelImportForm): component_name = self.cleaned_data.get('component_name') device = self.cleaned_data.get("device") - if not device and hasattr(self, 'instance'): + if not device and hasattr(self, 'instance') and hasattr(self.instance, 'device'): device = self.instance.device if not all([device, content_type, component_name]):