From b1e2c96c5ae03cfc5853d2297bb2c1ee86b47fb6 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Mon, 1 Apr 2019 12:10:12 +0200 Subject: [PATCH] Allow reviewers and partners to access their own submissions as applicants. --- opentech/apply/funds/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 7f6a61e19..d28a7d595 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -468,6 +468,10 @@ class ReviewerSubmissionDetailView(ReviewContextMixin, ActivityContextMixin, Del def dispatch(self, request, *args, **kwargs): submission = self.get_object() + # If the requesting user submitted the application, return the Applicant view. + # Reviewers and partners may somtimes be appliants as well. + if submission.user == request.user: + return ApplicantSubmissionDetailView.as_view()(request, *args, **kwargs) # Only allow partners in the submission they are added as partners if request.user.is_partner: partner_has_access = submission.partners.filter(pk=request.user.pk).exists() -- GitLab