feat: mlog validate时计算count_notok

This commit is contained in:
caoqianming 2024-01-20 23:30:09 +08:00
parent c88f33ad4d
commit 6f8c7c0567
1 changed files with 5 additions and 0 deletions

View File

@ -289,6 +289,11 @@ class MlogSerializer(CustomModelSerializer):
def validate(self, attrs):
mtask = attrs.get('mtask', None)
count_notok = 0
for i in attrs:
if 'count_n_' in i:
count_notok = count_notok + attrs[i]
attrs['count_notok'] = count_notok
if mtask:
if mtask.start_date == mtask.end_date:
attrs['handle_date'] = mtask.start_date