mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Fixes #13285: Cast default u_height value to a decimal for validation
This commit is contained in:
parent
9d0457fe1a
commit
90146941b5
@ -232,7 +232,7 @@ class DeviceType(PrimaryModel, WeightMixin):
|
|||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
# U height must be divisible by 0.5
|
# U height must be divisible by 0.5
|
||||||
if self.u_height % decimal.Decimal(0.5):
|
if decimal.Decimal(self.u_height) % decimal.Decimal(0.5):
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'u_height': "U height must be in increments of 0.5 rack units."
|
'u_height': "U height must be in increments of 0.5 rack units."
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user