1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 05:42:23 +00: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
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 5 additions and 1 deletions

View File

@ -142,10 +142,13 @@ class TournamentForm(forms.ModelForm):
'inscription_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'), 'inscription_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'),
'solution_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'), 'solution_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'),
'solutions_draw': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'), 'solutions_draw': forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M'),
'date_first_phase': forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'),
'syntheses_first_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, 'syntheses_first_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'},
format='%Y-%m-%d %H:%M'), format='%Y-%m-%d %H:%M'),
'date_second_phase': forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'),
'syntheses_second_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, 'syntheses_second_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'},
format='%Y-%m-%d %H:%M'), format='%Y-%m-%d %H:%M'),
'date_third_phase': forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'),
'syntheses_third_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'}, 'syntheses_third_phase_limit': forms.DateTimeInput(attrs={'type': 'datetime-local'},
format='%Y-%m-%d %H:%M'), format='%Y-%m-%d %H:%M'),
'organizers': forms.SelectMultiple(attrs={ 'organizers': forms.SelectMultiple(attrs={

View File

@ -837,7 +837,8 @@ class SolutionView(LoginRequiredMixin, View):
or user.registration.participates and user.registration.team or user.registration.participates and user.registration.team
and (solution.participation.team == user.registration.team or and (solution.participation.team == user.registration.team or
any(passage.pool.round == 1 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()))): for passage in passage_participant_qs.all()))):
raise PermissionDenied raise PermissionDenied
# Guess mime type of the file # Guess mime type of the file