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']: