diff --git a/netbox/dcim/models/device_component_templates.py b/netbox/dcim/models/device_component_templates.py index 6791e2f1c..87ea31d6f 100644 --- a/netbox/dcim/models/device_component_templates.py +++ b/netbox/dcim/models/device_component_templates.py @@ -672,12 +672,12 @@ class ModuleBayTemplate(ModularComponentTemplateModel): verbose_name = _('module bay template') verbose_name_plural = _('module bay templates') - def instantiate(self, device): + def instantiate(self, **kwargs): return self.component_model( - device=device, name=self.name, label=self.label, - position=self.position + position=self.position, + **kwargs ) instantiate.do_not_call_in_templates = True diff --git a/netbox/dcim/models/devices.py b/netbox/dcim/models/devices.py index a790cceef..4c386fca4 100644 --- a/netbox/dcim/models/devices.py +++ b/netbox/dcim/models/devices.py @@ -1224,7 +1224,8 @@ class Module(PrimaryModel, ConfigContextModel): ("powerporttemplates", "powerports", PowerPort), ("poweroutlettemplates", "poweroutlets", PowerOutlet), ("rearporttemplates", "rearports", RearPort), - ("frontporttemplates", "frontports", FrontPort) + ("frontporttemplates", "frontports", FrontPort), + ("modulebaytemplates", "modulebays", ModuleBay), ]: create_instances = [] update_instances = []