From 039876349e5e78d9958fa9a7c078a15b2699a706 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 4 Aug 2023 15:34:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mpointserializer=20validate=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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