diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 3724ac3bd..9554c1ddf 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -15,6 +15,7 @@ * [#8377](https://github.com/netbox-community/netbox/issues/8377) - Fix calculation of absolute cable lengths when specified in fractional units * [#8456](https://github.com/netbox-community/netbox/issues/8456) - Fix redundant display of VRF RD in prefix view +* [#8465](https://github.com/netbox-community/netbox/issues/8465) - Accept empty string values for Interface `rf_channel` in REST API --- diff --git a/netbox/dcim/api/serializers.py b/netbox/dcim/api/serializers.py index 337fd35c6..6549e51a1 100644 --- a/netbox/dcim/api/serializers.py +++ b/netbox/dcim/api/serializers.py @@ -621,7 +621,7 @@ class InterfaceSerializer(PrimaryModelSerializer, LinkTerminationSerializer, Con lag = NestedInterfaceSerializer(required=False, allow_null=True) mode = ChoiceField(choices=InterfaceModeChoices, allow_blank=True, required=False) rf_role = ChoiceField(choices=WirelessRoleChoices, required=False, allow_null=True) - rf_channel = ChoiceField(choices=WirelessChannelChoices, required=False) + rf_channel = ChoiceField(choices=WirelessChannelChoices, required=False, allow_blank=True) untagged_vlan = NestedVLANSerializer(required=False, allow_null=True) tagged_vlans = SerializedPKRelatedField( queryset=VLAN.objects.all(), diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index bc6b18ead..f403fa3eb 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -9,6 +9,7 @@ from dcim.models import * from ipam.models import ASN, RIR, VLAN from utilities.testing import APITestCase, APIViewTestCases from virtualization.models import Cluster, ClusterType +from wireless.choices import WirelessChannelChoices from wireless.models import WirelessLAN @@ -1239,10 +1240,8 @@ class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase 'name': 'Interface 4', 'type': '1000base-t', 'mode': InterfaceModeChoices.MODE_TAGGED, - 'tx_power': 10, 'tagged_vlans': [vlans[0].pk, vlans[1].pk], 'untagged_vlan': vlans[2].pk, - 'wireless_lans': [wireless_lans[0].pk, wireless_lans[1].pk], }, { 'device': device.pk, @@ -1250,10 +1249,8 @@ class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase 'type': '1000base-t', 'mode': InterfaceModeChoices.MODE_TAGGED, 'bridge': interfaces[0].pk, - 'tx_power': 10, 'tagged_vlans': [vlans[0].pk, vlans[1].pk], 'untagged_vlan': vlans[2].pk, - 'wireless_lans': [wireless_lans[0].pk, wireless_lans[1].pk], }, { 'device': device.pk, @@ -1261,10 +1258,24 @@ class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase 'type': 'virtual', 'mode': InterfaceModeChoices.MODE_TAGGED, 'parent': interfaces[1].pk, - 'tx_power': 10, 'tagged_vlans': [vlans[0].pk, vlans[1].pk], 'untagged_vlan': vlans[2].pk, + }, + { + 'device': device.pk, + 'name': 'Interface 7', + 'type': InterfaceTypeChoices.TYPE_80211A, + 'tx_power': 10, 'wireless_lans': [wireless_lans[0].pk, wireless_lans[1].pk], + 'rf_channel': WirelessChannelChoices.CHANNEL_5G_32, + }, + { + 'device': device.pk, + 'name': 'Interface 8', + 'type': InterfaceTypeChoices.TYPE_80211A, + 'tx_power': 10, + 'wireless_lans': [wireless_lans[0].pk, wireless_lans[1].pk], + 'rf_channel': "", }, ]