Description
NetBox version
v3.3.8 (fresh installation)
Python version
3.10
Steps to Reproduce
I create locations in a hierarchical order with 3 layers.
Layer 1: buildings
Layer 2: floors
Layer 3: rooms
I created child locations(rooms) with "Add Child Location" button and some of them on the wrong floor.
To correct this I edit (single edit) the location with the wrong floor and change the parent of this location object to the right one.
Here for locations "building A_room 0.01" and "building A_room 0.02" to change the parent to "building A - ground" with no problems.
But if I use "Bulk Edit" over the "Edit Selected" button(from a VM snapshot), here for locations "building A_room 0.01" and "building A_room 0.02", to change the parent to "building A - ground", I get this as result.
The hierarchical order of this locations is destroyed/mixed up.
location "building A - ground"
location "building A - room 0.01"
Expected Behavior
Move all selected locations with "bulk edit" to the correct parent location.
Observed Behavior
Rooms seems to be in more than one parent location and some location objects not moveable/editable any more, even if want to remove(Set Null) the parent in the location object, independent of the edit mode I used.
In some situations I also get an server error if I want to remove a parent of a location.
Like this location object
In edit location I removed the parent location and get this error message.
Complete error message:
<class 'django.db.utils.IntegrityError'>
new row for relation "dcim_location" violates check constraint "dcim_location_level_check"
DETAIL: Failing row contains (2022-11-17 14:15:01.236855+00, 2022-11-17 14:15:01.236905+00, {}, 30, building A - ground, building-a-ground, , 2, 23, 2, -1, 27, 1, null, active).Python version: 3.10.6
NetBox version: 3.3.8