From a462550f5607221cb32e1cbfc4d164102ce7d1cd Mon Sep 17 00:00:00 2001 From: Nico Vermaas <vermaas@astron.nl> Date: Fri, 1 Apr 2022 12:31:09 +0200 Subject: [PATCH] Failures Page --- atdb/taskdatabase/models.py | 4 ++-- .../taskdatabase/failures/tasks_failures.html | 11 ++++------- .../failures/tasks_failures_headers.html | 8 +------- .../templates/taskdatabase/index.html | 2 +- atdb/taskdatabase/views.py | 15 ++++----------- 5 files changed, 12 insertions(+), 28 deletions(-) diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py index 607a9f36..7c7023ec 100644 --- a/atdb/taskdatabase/models.py +++ b/atdb/taskdatabase/models.py @@ -104,7 +104,7 @@ class Task(models.Model): @property def has_quality(self): - # todo: check if there is a 'quality' structure in the 'task.outputs' + # todo: check if there is a 'quality' structure in the 'task.outputs'? try: quality = self.outputs['quality'] return True @@ -117,7 +117,7 @@ class Task(models.Model): @property def quality(self): - # todo: check if there is a 'quality' structure in the 'task.outputs' + # todo: check if there is a 'quality' structure in the 'task.outputs'? try: return self.outputs['quality'] except: diff --git a/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures.html b/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures.html index 75c461e2..796d6e52 100644 --- a/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures.html +++ b/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures.html @@ -29,14 +29,11 @@ <td>{{ task.sas_id }}</td> <td>{{ task.filter }} </td> - - {% if task.has_quality %} - {% for value in task.quality_as_list %} - <td>{{value}}</td> - {% endfor %} + {% if task.status == "processed_failed" %} + <td> + <a href="{% url 'task-setstatus-view' task.pk 'fetched' my_tasks.number %}" class="btn btn-warning btn-sm" role="button"><b><i class="fas fa-sync-alt"></i> Retry</b></a> + </td> {% endif %} - - <td> </tr> diff --git a/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures_headers.html b/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures_headers.html index cd699a59..5bf48b68 100644 --- a/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures_headers.html +++ b/atdb/taskdatabase/templates/taskdatabase/failures/tasks_failures_headers.html @@ -6,11 +6,5 @@ <th>Project</th> <th>SAS_ID</th> <th>filter</th> - <th>uv-coverage</th> - <th>Sensitivity</th> - <th>Conditions</th> - <th>Diagnostic plots</th> - <th>Summary parset</th> - <th>Summary logs</th> - <th>Summary hf5</th> + <th>Actions</th> </tr> \ No newline at end of file diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index 3870b8fc..0e2c23da 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 1.0.0 (1 apr 2021 - 08:00) + <p class="footer"> Version 1.0.0 (1 apr 2021 - 12:00) </div> diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index e13381a8..f3ccb8ca 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -359,9 +359,9 @@ class ShowQualityPage(ListView): tasks = get_searched_tasks(search_box, sort) # exclude the tasks without quality information - tasks = tasks.exclude(outputs__isnull=True) - tasks = tasks.exclude(outputs__0__quality__isnull=True) - + #tasks = tasks.exclude(outputs__isnull=True) + tasks = tasks.exclude(outputs__quality__isnull=True) + #tasks = tasks.exclude(outputs__0__quality__isnull=True) paginator = Paginator(tasks, config.TASKS_PER_PAGE) # Show 50 tasks per page page = self.request.GET.get('page') @@ -421,8 +421,6 @@ class ShowValidationPage(ListView): # exclude the tasks without quality information tasks = tasks.exclude(status__icontains="failed") - #tasks = tasks.exclude(outputs__0__quality__isnull=True) - paginator = Paginator(tasks, config.TASKS_PER_PAGE) # Show 50 tasks per page page = self.request.GET.get('page') @@ -468,7 +466,7 @@ class ShowFailuresPage(ListView): except: sort = '-creationTime' - tasks = Task.objects.order_by(sort) + tasks = Task.objects.filter(status__icontains='failed').order_by(sort) # check if there is a 'task_filter' put on the session try: @@ -481,11 +479,6 @@ class ShowFailuresPage(ListView): if (search_box is not None): tasks = get_searched_tasks(search_box, sort) - # exclude the tasks without quality information - tasks = tasks.exclude(outputs__isnull=True) - tasks = tasks.exclude(outputs__0__quality__isnull=True) - - paginator = Paginator(tasks, config.TASKS_PER_PAGE) # Show 50 tasks per page page = self.request.GET.get('page') -- GitLab