1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge v3.1.9

This commit is contained in:
jeremystretch
2022-03-07 10:55:30 -05:00
19 changed files with 217 additions and 97 deletions

View File

@@ -804,10 +804,11 @@ class Device(NetBoxModel, ConfigContextModel):
})
# Prevent 0U devices from being assigned to a specific position
if self.position and self.device_type.u_height == 0:
raise ValidationError({
'position': f"A U0 device type ({self.device_type}) cannot be assigned to a rack position."
})
if hasattr(self, 'device_type'):
if self.position and self.device_type.u_height == 0:
raise ValidationError({
'position': f"A U0 device type ({self.device_type}) cannot be assigned to a rack position."
})
if self.rack: