diff --git a/apiserver/bll/project/project_bll.py b/apiserver/bll/project/project_bll.py index 0562df4..fe74c21 100644 --- a/apiserver/bll/project/project_bll.py +++ b/apiserver/bll/project/project_bll.py @@ -341,6 +341,17 @@ class ProjectBLL: ) -> Tuple[Sequence, Sequence]: archived = EntityVisibility.archived.value + def project_task_fields(): + return { + "$project": { + "project": 1, + "status": 1, + "system_tags": 1, + "started": 1, + "completed": 1, + } + } + def ensure_valid_fields(): """ Make sure system tags is always an array (required by subsequent $in in archived_tasks_cond @@ -368,6 +379,7 @@ class ProjectBLL: users=users, ) }, + project_task_fields(), ensure_valid_fields(), { "$group": { @@ -516,6 +528,7 @@ class ProjectBLL: users=users, ) }, + project_task_fields(), ensure_valid_fields(), { # for each project diff --git a/apiserver/bll/statistics/stats_reporter.py b/apiserver/bll/statistics/stats_reporter.py index 1203962..77fd083 100644 --- a/apiserver/bll/statistics/stats_reporter.py +++ b/apiserver/bll/statistics/stats_reporter.py @@ -254,6 +254,14 @@ class StatisticsReporter: **({"last_worker": {"$in": workers}} if workers else {}), } }, + { + "$project": { + "last_worker": 1, + "last_update": 1, + "started": 1, + "last_iteration": 1, + } + }, { "$group": { "_id": "$last_worker" if workers else None,