瀏覽代碼

feat(forms): Add context handling for ModuleBay field (#20586)

Martin Hauser 5 月之前
父節點
當前提交
5334c8143c
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      netbox/dcim/forms/model_forms.py

+ 4 - 1
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'),