mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 02:06:42 -06:00
Closes #3652: Limit next/previous rack by assigned rack group
This commit is contained in:
parent
846acf7e9d
commit
60ec3fde9d
@ -15,6 +15,7 @@
|
|||||||
* [#3629](https://github.com/netbox-community/netbox/issues/3629) - Use `get_lldp_neighors_detail` to validation LLDP neighbors
|
* [#3629](https://github.com/netbox-community/netbox/issues/3629) - Use `get_lldp_neighors_detail` to validation LLDP neighbors
|
||||||
* [#3635](https://github.com/netbox-community/netbox/issues/3635) - Add missing cache support for the circuits app
|
* [#3635](https://github.com/netbox-community/netbox/issues/3635) - Add missing cache support for the circuits app
|
||||||
* [#3636](https://github.com/netbox-community/netbox/issues/3636) - Add missing `rack_group` field to PowerFeed CSV export
|
* [#3636](https://github.com/netbox-community/netbox/issues/3636) - Add missing `rack_group` field to PowerFeed CSV export
|
||||||
|
* [#3652](https://github.com/netbox-community/netbox/issues/3652) - Limit next/previous rack by assigned rack group
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -404,8 +404,12 @@ class RackView(PermissionRequiredMixin, View):
|
|||||||
position__isnull=True,
|
position__isnull=True,
|
||||||
parent_bay__isnull=True
|
parent_bay__isnull=True
|
||||||
).prefetch_related('device_type__manufacturer')
|
).prefetch_related('device_type__manufacturer')
|
||||||
next_rack = Rack.objects.filter(site=rack.site, name__gt=rack.name).order_by('name').first()
|
if rack.group:
|
||||||
prev_rack = Rack.objects.filter(site=rack.site, name__lt=rack.name).order_by('-name').first()
|
peer_racks = Rack.objects.filter(site=rack.site, group=rack.group)
|
||||||
|
else:
|
||||||
|
peer_racks = Rack.objects.filter(site=rack.site, group__isnull=True)
|
||||||
|
next_rack = peer_racks.filter(name__gt=rack.name).order_by('name').first()
|
||||||
|
prev_rack = peer_racks.filter(name__lt=rack.name).order_by('-name').first()
|
||||||
|
|
||||||
reservations = RackReservation.objects.filter(rack=rack)
|
reservations = RackReservation.objects.filter(rack=rack)
|
||||||
power_feeds = PowerFeed.objects.filter(rack=rack).prefetch_related('power_panel')
|
power_feeds = PowerFeed.objects.filter(rack=rack).prefetch_related('power_panel')
|
||||||
|
Loading…
Reference in New Issue
Block a user