From 4c1199e00951d889e729bc8e0a9e246981771874 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 6 Jan 2022 08:54:05 -0500 Subject: [PATCH] Fixes #8255: Fix bulk editing of authentication parameters for wireless LANs and links --- docs/release-notes/version-3.1.md | 1 + netbox/wireless/forms/bulk_edit.py | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index a51437092..4dbeb5087 100644 --- a/docs/release-notes/version-3.1.md +++ b/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 --- diff --git a/netbox/wireless/forms/bulk_edit.py b/netbox/wireless/forms/bulk_edit.py index 314c42653..9d07d09f0 100644 --- a/netbox/wireless/forms/bulk_edit.py +++ b/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: