mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Don't adopt components already belonging to a module
This commit is contained in:
parent
7de27c69c0
commit
81c7fe2084
@ -1091,7 +1091,8 @@ class Module(NetBoxModel, ConfigContextModel):
|
|||||||
template_instance = template.instantiate(device=self.device, module=self)
|
template_instance = template.instantiate(device=self.device, module=self)
|
||||||
|
|
||||||
if adopt_components:
|
if adopt_components:
|
||||||
existing_item = getattr(self.device, component_attribute).filter(name=template_instance.name).first()
|
existing_item = getattr(self.device, component_attribute).filter(
|
||||||
|
module__isnull=True, name=template_instance.name).first()
|
||||||
|
|
||||||
# Check if there's a component with the same name already
|
# Check if there's a component with the same name already
|
||||||
if existing_item:
|
if existing_item:
|
||||||
|
Loading…
Reference in New Issue
Block a user