Skip to content

Commit

Permalink
[forest-fixes] forest task log now contains task uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
biblicabeebli committed Dec 12, 2023
1 parent a2229b6 commit f98ad10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions frontend/templates/forest/task_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
<thead>
<tr>
<th scope="col">Created On</th>
<th scope="col">Task ID</th>
<th scope="col">Patient ID</th>
<th scope="col">Tree</th>
<th scope="col">Data Start Date</th>
<th scope="col">Data End Date</th>
<th scope="col">Data Start and End Date</th>
<th scope="col">Status</th>
{% if site_admin %}
<th scope="col">Actions</th>
Expand All @@ -58,10 +58,10 @@
</tr>
<tr ng-repeat="log in filterableObjects" ng-if="(log.created_on_display + log.patient_id + log.forest_tree_display + log.data_date_start + log.data_date_end + log.status).toLowerCase().includes(filterText.toLowerCase())">
<td>{% raw %}{{ log.created_on_display }}{% endraw %}</td>
<td>{% raw %}{{ log.external_id }}{% endraw %}</td>
<td>{% raw %}{{ log.patient_id }}{% endraw %}</td>
<td>{% raw %}{{ log.forest_tree_display }}{% endraw %}</td>
<td>{% raw %}{{ log.data_date_start }}{% endraw %}</td>
<td>{% raw %}{{ log.data_date_end }}{% endraw %}</td>
<td>Start: {% raw %}{{ log.data_date_start }}{% endraw %} <br> End: {% raw %}{{ log.data_date_end }}{% endraw %}</td>
<td ng-class="{ {{ status_choices.queued }}: 'list-group-item-info',
{{ status_choices.running }}: 'list-group-item-primary',
{{ status_choices.success }}: 'list-group-item-success',
Expand Down
13 changes: 9 additions & 4 deletions pages/forest_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,18 @@ def task_log(request: ResearcherRequest, study_id=None):
task_dict["created_on_display"] = task_dict.pop("created_on").strftime(DEV_TIME_FORMAT)
task_dict["forest_output_exists_display"] = display_true(task_dict["forest_output_exists"])

# dates/times that require safety
# dates/times that require safety (yes it could be less obnoxious)
task_dict["process_end_time"] = task_dict["process_end_time"].strftime(DEV_TIME_FORMAT) \
if task_dict["process_end_time"] else None
if task_dict["process_end_time"] else None
task_dict["process_start_time"] = task_dict["process_start_time"].strftime(DEV_TIME_FORMAT) \
if task_dict["process_start_time"] else None
if task_dict["process_start_time"] else None
task_dict["process_download_end_time"] = task_dict["process_download_end_time"].strftime(DEV_TIME_FORMAT) \
if task_dict["process_download_end_time"] else None
if task_dict["process_download_end_time"] else None
task_dict["data_date_end"] = task_dict["data_date_end"].isoformat() \
if task_dict["data_date_end"] else None
task_dict["data_date_start"] = task_dict["data_date_start"].isoformat() \
if task_dict["data_date_start"] else None

# urls
task_dict["cancel_url"] = easy_url(
"forest_pages.cancel_task", study_id=study_id, forest_task_external_id=extern_id,
Expand Down

0 comments on commit f98ad10

Please sign in to comment.