소스 검색

Fixes #13285: Cast default u_height value to a decimal for validation

Jeremy Stretch 2 년 전
부모
커밋
90146941b5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/dcim/models/devices.py

+ 1 - 1
netbox/dcim/models/devices.py

@@ -232,7 +232,7 @@ class DeviceType(PrimaryModel, WeightMixin):
         super().clean()
 
         # 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({
                 'u_height': "U height must be in increments of 0.5 rack units."
             })