1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes : Permit the creation of 0U device types via REST API

This commit is contained in:
jeremystretch
2022-08-25 08:37:43 -04:00
parent ec2e8ad184
commit 482b4b6e95
3 changed files with 5 additions and 1 deletions
docs/release-notes
netbox/dcim

@ -27,6 +27,7 @@
* [#10109](https://github.com/netbox-community/netbox/issues/10109) - Fix available prefixes calculation for container prefixes in the global table
* [#10111](https://github.com/netbox-community/netbox/issues/10111) - Wrap search QS to catch ValueError on identifier field
* [#10134](https://github.com/netbox-community/netbox/issues/10134) - Custom fields data serializer should return a 400 response for invalid data
* [#10147](https://github.com/netbox-community/netbox/issues/10147) - Permit the creation of 0U device types via REST API
---

@ -310,7 +310,7 @@ class DeviceTypeSerializer(NetBoxModelSerializer):
max_digits=4,
decimal_places=1,
label='Position (U)',
min_value=decimal.Decimal(0.5),
min_value=0,
default=1.0
)
subdevice_role = ChoiceField(choices=SubdeviceRoleChoices, allow_blank=True, required=False)

@ -461,16 +461,19 @@ class DeviceTypeTest(APIViewTestCases.APIViewTestCase):
'manufacturer': manufacturers[1].pk,
'model': 'Device Type 4',
'slug': 'device-type-4',
'u_height': 0,
},
{
'manufacturer': manufacturers[1].pk,
'model': 'Device Type 5',
'slug': 'device-type-5',
'u_height': 0.5,
},
{
'manufacturer': manufacturers[1].pk,
'model': 'Device Type 6',
'slug': 'device-type-6',
'u_height': 1,
},
]