From 2edefabd59494ac5907d5e173d7bd5d60d0d9370 Mon Sep 17 00:00:00 2001 From: shahzeydyfah Date: Thu, 29 May 2025 15:23:36 +0330 Subject: [PATCH] fix(report):check first_time --- app/repositories/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/repositories/report.py b/app/repositories/report.py index be0ef14..ceaa46c 100644 --- a/app/repositories/report.py +++ b/app/repositories/report.py @@ -287,7 +287,7 @@ class ReportRepository(): list_project = await use_collection(TaskEnv.CLN_PROJECT).find({"_id":{"$in":get_list_project_id}}).to_list(None) if list_project: for i in list_project: - if i['monitor']['detail']['first_time'] and i['monitor']['sts'] == 5: + if 'first_time' in i['monitor']['detail'] and i['monitor']['sts'] == 5: cal = (get_dict_project_id[str(i["_id"])]['sum']/i['monitor']['detail']['first_time'])*100 if cal < 20 : result['less_than_20'].append(i["_id"])