feat: mgroups_allocate保存时带mgroup_name

This commit is contained in:
caoqianming 2023-07-11 14:29:32 +08:00
parent c0e4b8a1b9
commit c3d0fa1806
1 changed files with 1 additions and 1 deletions

View File

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