Fix permission to see solutions when they are available
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
cf92c78d03
commit
9bf3b7dff0
|
@ -142,10 +142,13 @@ class TournamentForm(forms.ModelForm):
|
|||
'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'),
|
||||
'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'},
|
||||
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'},
|
||||
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'},
|
||||
format='%Y-%m-%d %H:%M'),
|
||||
'organizers': forms.SelectMultiple(attrs={
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue