From 301535813b3c5efca5ea20e895f7d9b46e2bbd30 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 29 Aug 2024 15:13:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mlogbout=20=E6=A0=A1=E9=AA=8C=E4=B8=8D?= =?UTF-8?q?=E5=90=88=E6=A0=BC=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 064b610e..06f0bfc7 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -428,6 +428,8 @@ class MlogbOutUpdateSerializer(CustomModelSerializer): count_notok = 0 for i in attrs: if 'count_n_' in i: + if not hasattr(Mlogb, i): + raise ValidationError(f'{i}不存在') count_notok = count_notok + attrs[i] attrs['count_notok'] = count_notok if attrs['count_real'] >= attrs['count_ok'] + attrs['count_notok']: