From 42c249330e8e2beb175d33fc11d30dbf5577aefd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 22 Apr 2025 09:14:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mlogbin=E8=A7=A3=E5=86=B3=E8=B4=9F?= =?UTF-8?q?=E5=80=BC=E6=A0=A1=E9=AA=8C=E5=AD=98=E5=9C=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index e025c4c6..6a21170c 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -688,7 +688,7 @@ class MlogbInSerializer(CustomModelSerializer): 'wm_in': {'required': True, "allow_empty": False}} def validate(self, attrs): - if attrs["count_use"] < 0 or attrs["count_pn_jgqbl"] < 0 or attrs["count_break"] < 0: + if attrs["count_use"] < 0 or attrs["count_pn_jgqbl"] < 0 or attrs.get("count_break", 0) < 0: raise ParseError('存在负数!') mlog:Mlog = attrs['mlog'] is_fix = mlog.is_fix