From 5334c8143c6b8a2e0962f266fa6f2b9d5ac4383e Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Mon, 20 Oct 2025 19:16:53 +0200 Subject: [PATCH] feat(forms): Add context handling for ModuleBay field (#20586) --- netbox/dcim/forms/model_forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py index 32ea2d263..c0dee533d 100644 --- a/netbox/dcim/forms/model_forms.py +++ b/netbox/dcim/forms/model_forms.py @@ -755,7 +755,10 @@ class ModuleForm(ModuleCommonForm, NetBoxModelForm): queryset=ModuleBay.objects.all(), query_params={ 'device_id': '$device' - } + }, + context={ + 'disabled': 'installed_module', + }, ) module_type = DynamicModelChoiceField( label=_('Module type'),