From eb115108dd365ab945bafbc22b6fe46df9d2e49f Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 15 Jun 2023 13:58:08 -0700 Subject: [PATCH] 12175 fix max height calc display --- netbox/dcim/models/racks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/models/racks.py b/netbox/dcim/models/racks.py index 17a35a527..079b75dab 100644 --- a/netbox/dcim/models/racks.py +++ b/netbox/dcim/models/racks.py @@ -240,8 +240,8 @@ class Rack(PrimaryModel, WeightMixin): position__isnull=True ).order_by('-position').first() if top_device: - min_height = top_device.position + top_device.device_type.u_height - 1 - if self.u_height + self.starting_unit - 1 < min_height: + min_height = top_device.position + top_device.device_type.u_height - self.starting_unit + if self.u_height < min_height: raise ValidationError({ 'u_height': "Rack must be at least {}U tall to house currently installed devices.".format( min_height