mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #9007: Fix FieldError exception when instantiating a device type with nested inventory items
This commit is contained in:
parent
1d55c04c21
commit
4fae42de51
@ -157,6 +157,7 @@ Where it is desired to limit the range of available VLANs within a group, users
|
||||
* [#8970](https://github.com/netbox-community/netbox/issues/8970) - Permit nested inventory item templates on device types
|
||||
* [#8976](https://github.com/netbox-community/netbox/issues/8976) - Add missing `object_type` field on CustomField REST API serializer
|
||||
* [#8978](https://github.com/netbox-community/netbox/issues/8978) - Fix instantiation of front ports when provisioning a module
|
||||
* [#9007](https://github.com/netbox-community/netbox/issues/9007) - Fix FieldError exception when instantiating a device type with nested inventory items
|
||||
|
||||
### Other Changes
|
||||
|
||||
|
@ -551,7 +551,7 @@ class InventoryItemTemplate(MPTTModel, ComponentTemplateModel):
|
||||
unique_together = ('device_type', 'parent', 'name')
|
||||
|
||||
def instantiate(self, **kwargs):
|
||||
parent = InventoryItemTemplate.objects.get(name=self.parent.name, **kwargs) if self.parent else None
|
||||
parent = InventoryItem.objects.get(name=self.parent.name, **kwargs) if self.parent else None
|
||||
if self.component:
|
||||
model = self.component.component_model
|
||||
component = model.objects.get(name=self.component.name, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user