diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 8d1f75c0891eb81a5f09fce4b1419975c9f21bbd..8f05f408aa8908d9bbc0094e8b26b2f770f37f58 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -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 diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index 53d85761ada700916cc41c9a4d2c08fc2f0a460c..a69a9db54a0a4062dd82a75dc7acd3d5c77c2753 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -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> diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index 6214606b47a183b667e1e72d80d5395fc036fdd4..7ad57183ac6a0cce4661e2b76cdd4c9760cbc1b3 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -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