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

bugfix: validation page should ignore discarded

parent 6ccbc362
No related branches found
No related tags found
1 merge request!381Sdc 1607 bugfix discard repurpose aggregation
Pipeline #100076 passed
import logging; import logging;
from django.conf import settings from django.conf import settings
from django.db.models import Sum
from .common import State, AggregationStrategy, VERIFIED_STATUSSES, PROCESSED_STATUSSES, INGEST_FRACTION_STATUSSES, \ from .common import State, AggregationStrategy, VERIFIED_STATUSSES, PROCESSED_STATUSSES, INGEST_FRACTION_STATUSSES, \
UPDATE_ARCHIVE_STATUSSES, ACTIVITY_RESET_STATUSSEN UPDATE_ARCHIVE_STATUSSES, ACTIVITY_RESET_STATUSSEN
from taskdatabase.models import Task, Activity, Configuration from taskdatabase.models import Task, Activity, Configuration
......
...@@ -27,6 +27,7 @@ class State(Enum): ...@@ -27,6 +27,7 @@ class State(Enum):
FINISHED = "finished" FINISHED = "finished"
FINISHING = "finishing" FINISHING = "finishing"
SUSPENDED = "suspended" SUSPENDED = "suspended"
DISCARD = "discard"
DISCARDED = "discarded" DISCARDED = "discarded"
FAILED = "failed" FAILED = "failed"
COLLECTING_DATA = "collecting_data" COLLECTING_DATA = "collecting_data"
......
...@@ -688,7 +688,7 @@ def get_filtered_tasks(request, pre_filtered_tasks=None, distinct=None): ...@@ -688,7 +688,7 @@ def get_filtered_tasks(request, pre_filtered_tasks=None, distinct=None):
# this assumes a similarity between tasks that share a field used as 'distinct'. (in practise that is sas_id) # this assumes a similarity between tasks that share a field used as 'distinct'. (in practise that is sas_id)
# this is only the case for tasks of the same 'task_type', and currently this is only used for 'regular' tasks. # this is only the case for tasks of the same 'task_type', and currently this is only used for 'regular' tasks.
# (to turn that around, 'task_type=aggregation' should be omitted from this filter). # (to turn that around, 'task_type=aggregation' should be omitted from this filter).
my_distinct_tasks = filtered_tasks.filter(task_type='regular').order_by(distinct,my_sort).distinct(distinct) my_distinct_tasks = filtered_tasks.filter(task_type='regular').exclude(status='discarded').order_by(distinct,my_sort).distinct(distinct)
return filtered_tasks.filter(id__in=my_distinct_tasks).order_by(my_sort) return filtered_tasks.filter(id__in=my_distinct_tasks).order_by(my_sort)
else: else:
return filtered_tasks.order_by(my_sort) return filtered_tasks.order_by(my_sort)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment