Skip to content
Snippets Groups Projects
Commit f4c4d952 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Exclude previous stages from the submission dashboard

parent 35e0b9b2
No related branches found
No related tags found
No related merge requests found
......@@ -465,6 +465,10 @@ class ApplicationSubmissionQueryset(JSONOrderable):
def inactive(self):
return self.exclude(status__in=active_statuses)
def current(self):
# Applications which have the current stage active (have not been progressed)
return self.exclude(next__isnull=False)
class ApplicationSubmission(WorkflowHelpers, AbstractFormSubmission):
field_template = 'funds/includes/submission_field.html'
......
......@@ -30,6 +30,9 @@ class SubmissionListView(AllActivityContextMixin, SingleTableMixin, FilterView):
filterset_class = SubmissionFilter
def get_queryset(self):
return self.filterset_class._meta.model.objects.current()
def get_context_data(self, **kwargs):
active_filters = self.filterset.data
return super().get_context_data(active_filters=active_filters, **kwargs)
......@@ -42,6 +45,9 @@ class SubmissionSearchView(SingleTableMixin, FilterView):
filterset_class = SubmissionFilterAndSearch
def get_queryset(self):
return self.filterset_class._meta.model.objects.current()
def get_context_data(self, **kwargs):
search_term = self.request.GET.get('query')
......@@ -103,7 +109,7 @@ class AdminSubmissionDetailView(ActivityContextMixin, DelegateableView):
def get_context_data(self, **kwargs):
return super().get_context_data(
other_submissions=self.model.objects.filter(user=self.object.user).exclude(id=self.object.id),
other_submissions=self.model.objects.filter(user=self.object.user).current().exclude(id=self.object.id),
**kwargs,
)
......
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