1
0
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:
Yohann D'ANELLO
2020-05-05 18:29:02 +02:00
parent 28abf730a2
commit 4ce767d451
4 changed files with 116 additions and 98 deletions

View File

@ -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(),
}

View File

@ -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")