diff --git a/frontend/templates/forest/task_log.html b/frontend/templates/forest/task_log.html index 594820392..d29288419 100644 --- a/frontend/templates/forest/task_log.html +++ b/frontend/templates/forest/task_log.html @@ -115,19 +115,28 @@
Task Metadata
+
-
Patient ID
-
{% raw %}{{ modalLog.patient_id }}{% endraw %}
-
Tree
-
{% raw %}{{ modalLog.forest_tree_display }}{% endraw %}
-
Data Date Start
-
{% raw %}{{ modalLog.data_date_start }}{% endraw %}
-
Data Date End
-
{% raw %}{{ modalLog.data_date_end }}{% endraw %}
-
Status
-
{% raw %}{{ modalLog.status }}{% endraw %}
-
Created On
-
{% raw %}{{ modalLog.created_on_display }}{% endraw %}
+
+
Patient ID
+
{% raw %}{{ modalLog.patient_id }}{% endraw %}
+
Tree
+
{% raw %}{{ modalLog.forest_tree_display }}{% endraw %}
+
Task ID
+
{% raw %}{{ modalLog.external_id }}{% endraw %}
+
Forest Commit
+
{% raw %}{{ modalLog.forest_commit }}{% endraw %}
+
+
+
Data Date Start
+
{% raw %}{{ modalLog.data_date_start }}{% endraw %}
+
Data Date End
+
{% raw %}{{ modalLog.data_date_end }}{% endraw %}
+
Status
+
{% raw %}{{ modalLog.status }}{% endraw %}
+
Created On
+
{% raw %}{{ modalLog.created_on_display }}{% endraw %}
+
diff --git a/pages/forest_pages.py b/pages/forest_pages.py index 0f6ecbb4a..7c8af4d9a 100644 --- a/pages/forest_pages.py +++ b/pages/forest_pages.py @@ -1,7 +1,7 @@ import csv import pickle from collections import defaultdict -from datetime import date, datetime, timedelta +from datetime import date, datetime import orjson from django.contrib import messages @@ -45,7 +45,8 @@ "participant__patient_id", # -> patient_id "pickled_parameters", "forest_tree", # -> forest_tree_display as .title() - "output_zip_s3_path", # need to identify that it is present at all + "forest_commit", + "output_zip_s3_path", # need to identify that it is present at all # datetimes "process_end_time", # -> dev time format "process_start_time", # -> dev time format @@ -169,7 +170,12 @@ def task_log(request: ResearcherRequest, study_id=None): tasks = [] for task_dict in query: - extern_id = task_dict.pop("external_id") + extern_id = task_dict["external_id"] + + # the commit is populated when the task runs, not when it is queued. + task_dict["forest_commit"] = task_dict["forest_commit"] if task_dict["forest_commit"] else \ + "(exact commit missing)" + # renames (could be optimized in the query, but speedup is negligible) task_dict["patient_id"] = task_dict.pop("participant__patient_id")