Closed
Description
Environment
- Python version: 3.6.5
- NetBox version: 2.7.3
To fully unrack a device, you must blank out its rack, position, and face values.
The face
field has a non-null constraint and has an API validator that requires its value to be either front
or rear
, so it's not possible to blank out the value through the API which prevents the device from being removed from the rack.
Steps to Reproduce
- Create a device in netbox with values for rack, position, and face.
- Try to clear all three values with a PATCH like the following
curl -X PATCH "https://$NETBOX/api/dcim/devices/$ID/" -H "accept: application/json" -H "Content-Type: application/json" -H "X-CSRFToken: $TOKEN" -d "{ \"rack\": null, \"position\": null, \"face\": \"\"}"
Expected Behavior
The device to be unracked
Observed Behavior
{
"face": [
" is not a valid choice."
]
}
If passing null
for the face value, the django non-null constraint is hit.
If patching just the rack
and position
values without touching the face
, the Cannot select a rack face without assigning a rack.
validator is hit.