Skip to content

Commit aab8ee6

Browse files
committed
feat(forms): Add context handling for ModuleBay field
Extend the context of the `module_bay` field to support a `disabled` parameter. This facilitates the handling of installed modules and adds flexibility to form field rendering. Fixes #19751
1 parent 8cc6589 commit aab8ee6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netbox/dcim/forms/model_forms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,10 @@ class ModuleForm(ModuleCommonForm, NetBoxModelForm):
755755
queryset=ModuleBay.objects.all(),
756756
query_params={
757757
'device_id': '$device'
758-
}
758+
},
759+
context={
760+
'disabled': 'installed_module',
761+
},
759762
)
760763
module_type = DynamicModelChoiceField(
761764
label=_('Module type'),

0 commit comments

Comments
 (0)