mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #9847: Respect desc_units when ordering rack units
This commit is contained in:
@@ -244,10 +244,9 @@ class Rack(NetBoxModel):
|
||||
"""
|
||||
Return a list of unit numbers, top to bottom.
|
||||
"""
|
||||
max_position = self.u_height + decimal.Decimal(0.5)
|
||||
if self.desc_units:
|
||||
drange(0.5, max_position, 0.5)
|
||||
return drange(max_position, 0.5, -0.5)
|
||||
return drange(decimal.Decimal(1.0), self.u_height + 1, 0.5)
|
||||
return drange(self.u_height + decimal.Decimal(0.5), 0.5, -0.5)
|
||||
|
||||
def get_status_color(self):
|
||||
return RackStatusChoices.colors.get(self.status)
|
||||
|
Reference in New Issue
Block a user