fix: mpointserializer validate 错误

This commit is contained in:
caoqianming 2023-08-04 15:34:01 +08:00
parent 866ad4d15d
commit 039876349e
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class MpointSerializer(CustomModelSerializer):
raise ParseError('分配集错误') raise ParseError('分配集错误')
mgroupIds.append(i['mgroup']) mgroupIds.append(i['mgroup'])
i['mgroup_name'] = Mgroup.objects.get(id=i['mgroup']).name i['mgroup_name'] = Mgroup.objects.get(id=i['mgroup']).name
if round(ratio_, 3) != 1.0: if attrs['mgroups_allocate'] and round(ratio_, 3) != 1.0:
raise ParseError('比例合计错误') raise ParseError('比例合计错误')
return attrs return attrs