Преглед изворни кода

Fixes #8255: Fix bulk editing of authentication parameters for wireless LANs and links

jeremystretch пре 4 година
родитељ
комит
4c1199e009
2 измењених фајлова са 16 додато и 10 уклоњено
  1. 1 0
      docs/release-notes/version-3.1.md
  2. 15 10
      netbox/wireless/forms/bulk_edit.py

+ 1 - 0
docs/release-notes/version-3.1.md

@@ -14,6 +14,7 @@
 * [#8224](https://github.com/netbox-community/netbox/issues/8224) - Fix KeyError exception when creating FHRP group with IP address and protocol "other"
 * [#8226](https://github.com/netbox-community/netbox/issues/8226) - Honor return URL after populating a device bay
 * [#8228](https://github.com/netbox-community/netbox/issues/8228) - Optional ChoiceVar fields should not force a selection
+* [#8255](https://github.com/netbox-community/netbox/issues/8255) - Fix bulk editing of authentication parameters for wireless LANs and links
 
 ---
 

+ 15 - 10
netbox/wireless/forms/bulk_edit.py

@@ -3,7 +3,7 @@ from django import forms
 from dcim.choices import LinkStatusChoices
 from extras.forms import AddRemoveTagsForm, CustomFieldModelBulkEditForm
 from ipam.models import VLAN
-from utilities.forms import DynamicModelChoiceField
+from utilities.forms import add_blank_choice, DynamicModelChoiceField
 from wireless.choices import *
 from wireless.constants import SSID_MAX_LENGTH
 from wireless.models import *
@@ -45,24 +45,27 @@ class WirelessLANBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
     vlan = DynamicModelChoiceField(
         queryset=VLAN.objects.all(),
         required=False,
+        label='VLAN'
     )
     ssid = forms.CharField(
         max_length=SSID_MAX_LENGTH,
-        required=False
+        required=False,
+        label='SSID'
     )
     description = forms.CharField(
         required=False
     )
     auth_type = forms.ChoiceField(
-        choices=WirelessAuthTypeChoices,
+        choices=add_blank_choice(WirelessAuthTypeChoices),
         required=False
     )
     auth_cipher = forms.ChoiceField(
-        choices=WirelessAuthCipherChoices,
+        choices=add_blank_choice(WirelessAuthCipherChoices),
         required=False
     )
     auth_psk = forms.CharField(
-        required=False
+        required=False,
+        label='Pre-shared key'
     )
 
     class Meta:
@@ -76,25 +79,27 @@ class WirelessLinkBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
     )
     ssid = forms.CharField(
         max_length=SSID_MAX_LENGTH,
-        required=False
+        required=False,
+        label='SSID'
     )
     status = forms.ChoiceField(
-        choices=LinkStatusChoices,
+        choices=add_blank_choice(LinkStatusChoices),
         required=False
     )
     description = forms.CharField(
         required=False
     )
     auth_type = forms.ChoiceField(
-        choices=WirelessAuthTypeChoices,
+        choices=add_blank_choice(WirelessAuthTypeChoices),
         required=False
     )
     auth_cipher = forms.ChoiceField(
-        choices=WirelessAuthCipherChoices,
+        choices=add_blank_choice(WirelessAuthCipherChoices),
         required=False
     )
     auth_psk = forms.CharField(
-        required=False
+        required=False,
+        label='Pre-shared key'
     )
 
     class Meta: