Fix motivation letters
This commit is contained in:
parent
3d9e7136ac
commit
4a7d3c5604
|
@ -197,8 +197,11 @@ class DocumentView(AccessMixin, View):
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
grant = request.user.admin
|
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()
|
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):
|
if isinstance(doc, Solution):
|
||||||
for pool in doc.pools.all():
|
for pool in doc.pools.all():
|
||||||
|
|
Loading…
Reference in New Issue