diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 5300f860a48032bbc2bceb38a2d69968cbb60c89..9b4552e17e1f4f7897c8deeeb7178e16a65dfd68 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, )