From 4a7d3c56043c6cd98e9fd897965b973d5526250b Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 25 May 2020 19:24:19 +0200 Subject: [PATCH] Fix motivation letters --- apps/member/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/member/views.py b/apps/member/views.py index ac4b13e..702dc9c 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -197,8 +197,11 @@ class DocumentView(AccessMixin, View): if request.user.is_authenticated: grant = request.user.admin - if isinstance(doc, Solution) or isinstance(doc, Synthesis) or isinstance(doc, MotivationLetter): + if isinstance(doc, Solution) or isinstance(doc, Synthesis): grant = grant or doc.team == request.user.team or request.user in doc.tournament.organizers.all() + elif isinstance(doc, MotivationLetter): + grant = grant or doc.team == request.user.team or request.user in doc.team.tournament.organizers.all() + grant = grant or doc.team.selected_for_final and request.user in Tournament.get_final().organizers.all() if isinstance(doc, Solution): for pool in doc.pools.all():