diff --git a/apps/enm/serializers.py b/apps/enm/serializers.py index 0e022364..93066a4c 100644 --- a/apps/enm/serializers.py +++ b/apps/enm/serializers.py @@ -34,7 +34,7 @@ class MpointSerializer(CustomModelSerializer): raise ParseError('分配集错误') mgroupIds.append(i['mgroup']) 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('比例合计错误') return attrs