diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index f73d43c9e..c68b9a493 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -20,7 +20,8 @@ * [#7851](https://github.com/netbox-community/netbox/issues/7851) - Add missing cluster name filter for virtual machines * [#7857](https://github.com/netbox-community/netbox/issues/7857) - Fix ordering IP addresses by assignment status * [#7859](https://github.com/netbox-community/netbox/issues/7859) - Fix styling of form widgets under cable connection views -* [#7864](https://github.com/netbox-community/netbox/issues/7864) - `power_port` can be null when creating power outlets +* [#7864](https://github.com/netbox-community/netbox/issues/7864) - `power_port` can be null when creating power outlets via REST API +* [#7865](https://github.com/netbox-community/netbox/issues/7865) - REST API should support null values for console port speeds --- diff --git a/netbox/dcim/api/serializers.py b/netbox/dcim/api/serializers.py index 0872cce6d..a731860fe 100644 --- a/netbox/dcim/api/serializers.py +++ b/netbox/dcim/api/serializers.py @@ -539,7 +539,7 @@ class ConsoleServerPortSerializer(PrimaryModelSerializer, CableTerminationSerial ) speed = ChoiceField( choices=ConsolePortSpeedChoices, - allow_blank=True, + allow_null=True, required=False ) cable = NestedCableSerializer(read_only=True) @@ -563,7 +563,7 @@ class ConsolePortSerializer(PrimaryModelSerializer, CableTerminationSerializer, ) speed = ChoiceField( choices=ConsolePortSpeedChoices, - allow_blank=True, + allow_null=True, required=False ) cable = NestedCableSerializer(read_only=True) diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index 181d659d2..f6885806a 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -1042,14 +1042,17 @@ class ConsolePortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCa { 'device': device.pk, 'name': 'Console Port 4', + 'speed': 9600, }, { 'device': device.pk, 'name': 'Console Port 5', + 'speed': 115200, }, { 'device': device.pk, 'name': 'Console Port 6', + 'speed': None, }, ] @@ -1081,14 +1084,17 @@ class ConsoleServerPortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIView { 'device': device.pk, 'name': 'Console Server Port 4', + 'speed': 9600, }, { 'device': device.pk, 'name': 'Console Server Port 5', + 'speed': 115200, }, { 'device': device.pk, 'name': 'Console Server Port 6', + 'speed': None, }, ]