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

"suspended" and "discarded" tasks should not be included in the corresponding...

"suspended" and "discarded" tasks should not be included in the corresponding "Plots" and "Summary" lists, and should not block the validation
parent c2403c95
No related branches found
No related tags found
2 merge requests!290pull in the newest changes in master,!289"suspended" and "discarded" tasks
Checking pipeline status
...@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) ...@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
# constants # constants
datetime_format_string = '%Y-%m-%dT%H:%M:%SZ' datetime_format_string = '%Y-%m-%dT%H:%M:%SZ'
verified_statusses = ['stored','validated','scrubbed','archived','finished'] verified_statusses = ['stored','validated','scrubbed','archived','finished','suspended','discarded']
class Workflow(models.Model): class Workflow(models.Model):
description = models.CharField(max_length=500, blank=True, null=True) description = models.CharField(max_length=500, blank=True, null=True)
......
...@@ -724,6 +724,11 @@ def construct_inspectionplots(task,source='task_id'): ...@@ -724,6 +724,11 @@ def construct_inspectionplots(task,source='task_id'):
tasks = Task.objects.filter(sas_id=sas_id) tasks = Task.objects.filter(sas_id=sas_id)
for task in tasks: for task in tasks:
# skip 'suspended' and 'discarded' tasks
if task.status in ['suspended','discarded']:
continue
try: try:
results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>' results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>'
plots = task.quality_json["plots"] plots = task.quality_json["plots"]
...@@ -765,6 +770,11 @@ def construct_summary(task): ...@@ -765,6 +770,11 @@ def construct_summary(task):
tasks = Task.objects.filter(sas_id=sas_id) tasks = Task.objects.filter(sas_id=sas_id)
for task in tasks: for task in tasks:
# skip 'suspended' and 'discarded' tasks
if task.status in ['suspended', 'discarded']:
continue
results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>' results += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>Task ' + str(task.id) + '</b></td></tr>'
# find the plots in the quality json structure # find the plots in the quality json structure
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 4 April 2023 <p class="footer"> Version 6 April 2023
</div> </div>
......
...@@ -9,4 +9,6 @@ ...@@ -9,4 +9,6 @@
<a href="{% url 'task-details-setstatus' task.pk 'archived' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> archived</a>&nbsp; <a href="{% url 'task-details-setstatus' task.pk 'archived' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> archived</a>&nbsp;
<a href="{% url 'task-details-setstatus' task.pk 'finished' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> finished</a>&nbsp; <a href="{% url 'task-details-setstatus' task.pk 'finished' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> finished</a>&nbsp;
<a href="{% url 'task-details-setstatus' task.pk 'suspended' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> suspended</a>&nbsp; <a href="{% url 'task-details-setstatus' task.pk 'suspended' %}" class="btn btn-warning btn-sm" role="button"><i class="fas fa-sync-alt"></i> suspended</a>&nbsp;
<!--
<a href="{% url 'task-details-setstatus' task.pk 'discard' %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-sync-alt"></i> discard</a>&nbsp; <a href="{% url 'task-details-setstatus' task.pk 'discard' %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-sync-alt"></i> discard</a>&nbsp;
-->
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment