From 8b00c8e17386175df6ffd7b405c4d799ec6a37f1 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Wed, 14 Mar 2018 15:34:23 +0000 Subject: [PATCH] Remove the related application from the other submissions list --- opentech/apply/funds/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 5300f860a..9b4552e17 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -108,8 +108,12 @@ class AdminSubmissionDetailView(ActivityContextMixin, DelegateableView): } def get_context_data(self, **kwargs): + other_submissions = self.model.objects.filter(user=self.object.user).current().exclude(id=self.object.id) + if self.object.next: + other_submissions = other_submissions.exclude(id=self.object.next.id) + return super().get_context_data( - other_submissions=self.model.objects.filter(user=self.object.user).current().exclude(id=self.object.id), + other_submissions=other_submissions, **kwargs, ) -- GitLab