mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Corrected rack height validation to exclude 0U devices
This commit is contained in:
parent
df1147d941
commit
7918f85cdd
@ -187,7 +187,7 @@ class Rack(CreatedUpdatedModel):
|
|||||||
|
|
||||||
# Validate that Rack is tall enough to house the installed Devices
|
# Validate that Rack is tall enough to house the installed Devices
|
||||||
if self.pk:
|
if self.pk:
|
||||||
top_device = Device.objects.filter(rack=self).order_by('-position').first()
|
top_device = Device.objects.filter(rack=self).exclude(position__isnull=True).order_by('-position').first()
|
||||||
if top_device:
|
if top_device:
|
||||||
min_height = top_device.position + top_device.device_type.u_height - 1
|
min_height = top_device.position + top_device.device_type.u_height - 1
|
||||||
if self.u_height < min_height:
|
if self.u_height < min_height:
|
||||||
|
Loading…
Reference in New Issue
Block a user