fix: 比例合计问题

This commit is contained in:
caoqianming 2023-07-11 14:21:36 +08:00
parent a30bffd244
commit c0e4b8a1b9
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ class MpointSerializer(CustomModelSerializer):
if i['mgroup'] in mgroupIds:
raise ParseError('分配集错误')
mgroupIds.append(i['mgroup'])
if ratio_ != 1:
print(ratio_, round(ratio_, 2))
if round(ratio_, 3) != 1.0:
raise ParseError('比例合计错误')
return attrs