Przeglądaj źródła

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

Martin Hauser 4 miesięcy temu
rodzic
commit
5334c8143c
1 zmienionych plików z 4 dodań i 1 usunięć
  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'),