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

#11902 validate device on inventory item import

This commit is contained in:
Arthur
2023-04-25 14:44:45 -07:00
committed by Jeremy Stretch
parent d87235af2f
commit 1ad029712e

View File

@ -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]):