Skip to content
Snippets Groups Projects
Commit 1004b56e authored by Nico Vermaas's avatar Nico Vermaas
Browse files

bugfix: plots didn't show when 1 task missed outputs

parent 0a146890
No related branches found
No related tags found
No related merge requests found
Pipeline #44178 passed
......@@ -721,24 +721,27 @@ def construct_inspectionplots(task,source='task_id'):
tasks = Task.objects.filter(sas_id=sas_id)
for task in tasks:
results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>'
plots = task.quality_json["plots"]
for plot in plots:
basename = plot['basename']
checksum = plot['checksum']
#plot_file = basename + str(plot['size'])
plot_file = checksum
# only add unique files
if not plot_file in plot_files:
surl = plot['surl'] + "?action=show&authz=" + str(token)
url = surl.replace(translation[0], translation[1])
results += '<tr><td><a href="' + url + '" target="_blank">' + basename + '</a></td></tr>'
#results += '<tr><td><a href="' + url + '" target="_blank">' + basename + '</a></td><td>'+str(plot['size'])+'</td></tr>'
plot_files.append(plot_file)
try:
results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>'
plots = task.quality_json["plots"]
for plot in plots:
basename = plot['basename']
checksum = plot['checksum']
#plot_file = basename + str(plot['size'])
plot_file = checksum
# only add unique files
if not plot_file in plot_files:
surl = plot['surl'] + "?action=show&authz=" + str(token)
url = surl.replace(translation[0], translation[1])
results += '<tr><td><a href="' + url + '" target="_blank">' + basename + '</a></td></tr>'
#results += '<tr><td><a href="' + url + '" target="_blank">' + basename + '</a></td><td>'+str(plot['size'])+'</td></tr>'
plot_files.append(plot_file)
except Exception as error:
logger.info('task ' + str(task) + ' has no plots, skipped.')
return results
......
......@@ -34,7 +34,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 9 Februari 2023
<p class="footer"> Version 14 Februari 2023
</div>
......
......@@ -418,6 +418,7 @@ class ShowArchivedPage(ListView):
def get_queryset(self):
archived_tasks = Task.objects.filter(status='archived')
#tasks = get_filtered_tasks(self.request, archived_tasks, "sas_id")
tasks = get_filtered_tasks(self.request, archived_tasks)
paginator = Paginator(tasks, config.TASKS_PER_PAGE) # Show 50 tasks per page
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment