feat: mlogbout 校验不合格字段

This commit is contained in:
caoqianming 2024-08-29 15:13:08 +08:00
parent ab759a76c9
commit 301535813b
1 changed files with 2 additions and 0 deletions

View File

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