Skip to content
Snippets Groups Projects
Commit b1e2c96c authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Allow reviewers and partners to access their own submissions as applicants.

parent a281060d
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
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