ソースを参照

Closes #4821: Restrict group options by selected site when bulk editing VLANs

Jeremy Stretch 5 年 前
コミット
20ee8ec107
2 ファイル変更14 行追加1 行削除
  1. 8 0
      docs/release-notes/version-2.8.md
  2. 6 1
      netbox/ipam/forms.py

+ 8 - 0
docs/release-notes/version-2.8.md

@@ -1,5 +1,13 @@
 # NetBox v2.8
 # NetBox v2.8
 
 
+## v2.8.7 (FUTURE)
+
+### Bug Fixes
+
+* [#4821](https://github.com/netbox-community/netbox/issues/4821) - Restrict group options by selected site when bulk editing VLANs
+
+---
+
 ## v2.8.7 (2020-07-02)
 ## v2.8.7 (2020-07-02)
 
 
 ### Enhancements
 ### Enhancements

+ 6 - 1
netbox/ipam/forms.py

@@ -1068,7 +1068,12 @@ class VLANBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditFor
     )
     )
     site = DynamicModelChoiceField(
     site = DynamicModelChoiceField(
         queryset=Site.objects.all(),
         queryset=Site.objects.all(),
-        required=False
+        required=False,
+        widget=APISelect(
+            filter_for={
+                'group': 'site_id'
+            }
+        )
     )
     )
     group = DynamicModelChoiceField(
     group = DynamicModelChoiceField(
         queryset=VLANGroup.objects.all(),
         queryset=VLANGroup.objects.all(),