feat: mgroups_allocate保存时带mgroup_name
This commit is contained in:
parent
c0e4b8a1b9
commit
c3d0fa1806
|
|
@ -32,7 +32,7 @@ class MpointSerializer(CustomModelSerializer):
|
||||||
if i['mgroup'] in mgroupIds:
|
if i['mgroup'] in mgroupIds:
|
||||||
raise ParseError('分配集错误')
|
raise ParseError('分配集错误')
|
||||||
mgroupIds.append(i['mgroup'])
|
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:
|
if round(ratio_, 3) != 1.0:
|
||||||
raise ParseError('比例合计错误')
|
raise ParseError('比例合计错误')
|
||||||
return attrs
|
return attrs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue