1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 17:18:24 +02:00

Fix permission to see solutions when they are available

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-06-07 16:16:11 +02:00
parent cf92c78d03
commit 9bf3b7dff0
2 changed files with 5 additions and 1 deletions

View File

@ -837,7 +837,8 @@ class SolutionView(LoginRequiredMixin, View):
or user.registration.participates and user.registration.team
and (solution.participation.team == user.registration.team or
any(passage.pool.round == 1
or timezone.now() >= passage.pool.tournament.solutions_available_second_phase
or (passage.pool.round == 2 and passage.pool.tournament.solutions_available_second_phase)
or (passage.pool.round == 3 and passage.pool.tournament.solutions_available_third_phase)
for passage in passage_participant_qs.all()))):
raise PermissionDenied
# Guess mime type of the file