Просмотр исходного кода

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

Martin Hauser 3 месяцев назад
Родитель
Сommit
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'),