mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 03:56:53 -06:00
Fixes #772: Fix TypeError in API RackUnitListView when no device is excluded
This commit is contained in:
parent
52567c4ade
commit
0d4b2a6e92
@ -118,11 +118,13 @@ class RackUnitListView(APIView):
|
||||
|
||||
rack = get_object_or_404(Rack, pk=pk)
|
||||
face = request.GET.get('face', 0)
|
||||
try:
|
||||
exclude = int(request.GET.get('exclude', None))
|
||||
except ValueError:
|
||||
exclude = None
|
||||
elevation = rack.get_rack_units(face, exclude)
|
||||
exclude_pk = request.GET.get('exclude', None)
|
||||
if exclude_pk is not None:
|
||||
try:
|
||||
exclude_pk = int(exclude_pk)
|
||||
except ValueError:
|
||||
exclude_pk = None
|
||||
elevation = rack.get_rack_units(face, exclude_pk)
|
||||
|
||||
# Serialize Devices within the rack elevation
|
||||
for u in elevation:
|
||||
|
Loading…
Reference in New Issue
Block a user