mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-22 01:18:27 +02:00
Teams can't see problems for the second round until the given date
This commit is contained in:
@ -38,6 +38,8 @@ class TournamentForm(forms.ModelForm):
|
||||
"date_inscription": DateTimePickerInput(),
|
||||
"date_solutions": DateTimePickerInput(),
|
||||
"date_syntheses": DateTimePickerInput(),
|
||||
"date_solutions_2": DateTimePickerInput(),
|
||||
"date_syntheses_2": DateTimePickerInput(),
|
||||
}
|
||||
|
||||
|
||||
|
@ -456,6 +456,9 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
|
||||
pool = self.get_object()
|
||||
|
||||
if "solutions_zip" in request.POST:
|
||||
if user.participates and pool.round == 2 and pool.tournament.date_solutions_2 > timezone.now():
|
||||
raise PermissionDenied
|
||||
|
||||
out = BytesIO()
|
||||
zf = zipfile.ZipFile(out, "w")
|
||||
|
||||
@ -469,6 +472,9 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
|
||||
.format(_("Solutions of a pool.zip").replace(" ", "%20"))
|
||||
return resp
|
||||
elif "syntheses_zip" in request.POST and user.organizes:
|
||||
if user.participates and pool.round == 2 and pool.tournament.date_solutions_2 > timezone.now():
|
||||
raise PermissionDenied
|
||||
|
||||
out = BytesIO()
|
||||
zf = zipfile.ZipFile(out, "w")
|
||||
|
||||
|
Reference in New Issue
Block a user