mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:02:28 +00:00
Fix send solution error
This commit is contained in:
parent
4ce767d451
commit
75d8ec2265
@ -224,6 +224,10 @@ class SolutionsView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
|
|
||||||
return super().post(request, *args, **kwargs)
|
return super().post(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
self.object_list = self.get_queryset()
|
||||||
|
return super().get_context_data(**kwargs)
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = super().get_queryset()
|
qs = super().get_queryset()
|
||||||
if not self.request.user.admin:
|
if not self.request.user.admin:
|
||||||
@ -236,7 +240,7 @@ class SolutionsView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
solution.final = solution.team.selected_for_final
|
solution.final = solution.team.selected_for_final
|
||||||
|
|
||||||
if timezone.now() > solution.tournament.date_solutions:
|
if timezone.now() > solution.tournament.date_solutions:
|
||||||
form.add_error('file', _("You can't publish your solution anymore. Deadline: {date:%m-%d-%Y %h:%M}.")
|
form.add_error('file', _("You can't publish your solution anymore. Deadline: {date:%m-%d-%Y %H:%M}.")
|
||||||
.format(date=solution.tournament.date_solutions))
|
.format(date=solution.tournament.date_solutions))
|
||||||
return super().form_invalid(form)
|
return super().form_invalid(form)
|
||||||
|
|
||||||
@ -334,6 +338,10 @@ class SynthesesView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
return qs.order_by('team__tournament__date_start', 'team__tournament__name', 'team__trigram', 'round',
|
return qs.order_by('team__tournament__date_start', 'team__tournament__name', 'team__trigram', 'round',
|
||||||
'source',)
|
'source',)
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
self.object_list = self.get_queryset()
|
||||||
|
return super().get_context_data(**kwargs)
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
synthesis = form.instance
|
synthesis = form.instance
|
||||||
synthesis.team = self.request.user.team
|
synthesis.team = self.request.user.team
|
||||||
@ -341,13 +349,13 @@ class SynthesesView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
|
|
||||||
if synthesis.round == '1' and timezone.now() > synthesis.tournament.date_syntheses:
|
if synthesis.round == '1' and timezone.now() > synthesis.tournament.date_syntheses:
|
||||||
form.add_error('file', _("You can't publish your synthesis anymore for the first round."
|
form.add_error('file', _("You can't publish your synthesis anymore for the first round."
|
||||||
" Deadline: {date:%m-%d-%Y %h:%M}.")
|
" Deadline: {date:%m-%d-%Y %H:%M}.")
|
||||||
.format(date=synthesis.tournament.date_syntheses))
|
.format(date=synthesis.tournament.date_syntheses))
|
||||||
return super().form_invalid(form)
|
return super().form_invalid(form)
|
||||||
|
|
||||||
if synthesis.round == '2' and timezone.now() > synthesis.tournament.date_syntheses_2:
|
if synthesis.round == '2' and timezone.now() > synthesis.tournament.date_syntheses_2:
|
||||||
form.add_error('file', _("You can't publish your synthesis anymore for the second round."
|
form.add_error('file', _("You can't publish your synthesis anymore for the second round."
|
||||||
" Deadline: {date:%m-%d-%Y %h:%M}.")
|
" Deadline: {date:%m-%d-%Y %H:%M}.")
|
||||||
.format(date=synthesis.tournament.date_syntheses_2))
|
.format(date=synthesis.tournament.date_syntheses_2))
|
||||||
return super().form_invalid(form)
|
return super().form_invalid(form)
|
||||||
|
|
||||||
|
@ -610,9 +610,9 @@ msgstr "Solutions"
|
|||||||
|
|
||||||
#: apps/tournament/views.py:239
|
#: apps/tournament/views.py:239
|
||||||
msgid ""
|
msgid ""
|
||||||
"You can't publish your solution anymore. Deadline: {date:%m-%d-%Y %h:%M}."
|
"You can't publish your solution anymore. Deadline: {date:%m-%d-%Y %H:%M}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Vous ne pouvez plus publier vos solutions. Deadline : {date:%d/%m/%Y %h:%M}."
|
"Vous ne pouvez plus publier vos solutions. Deadline : {date:%d/%m/%Y %H:%M}."
|
||||||
|
|
||||||
#: apps/tournament/views.py:263
|
#: apps/tournament/views.py:263
|
||||||
msgid "All solutions"
|
msgid "All solutions"
|
||||||
@ -636,7 +636,7 @@ msgstr "Notes de synthèse de l'équipe {team}.zip"
|
|||||||
#: apps/tournament/views.py:343
|
#: apps/tournament/views.py:343
|
||||||
msgid ""
|
msgid ""
|
||||||
"You can't publish your synthesis anymore for the first round. Deadline: "
|
"You can't publish your synthesis anymore for the first round. Deadline: "
|
||||||
"{date:%m-%d-%Y %h:%M}."
|
"{date:%m-%d-%Y %H:%M}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Vous ne pouvez plus envoyer vos notes de synthèse pour le premier tour. "
|
"Vous ne pouvez plus envoyer vos notes de synthèse pour le premier tour. "
|
||||||
"Deadline : {date:%d/%m/%Y %h:%M}."
|
"Deadline : {date:%d/%m/%Y %h:%M}."
|
||||||
@ -644,7 +644,7 @@ msgstr ""
|
|||||||
#: apps/tournament/views.py:349
|
#: apps/tournament/views.py:349
|
||||||
msgid ""
|
msgid ""
|
||||||
"You can't publish your synthesis anymore for the second round. Deadline: "
|
"You can't publish your synthesis anymore for the second round. Deadline: "
|
||||||
"{date:%m-%d-%Y %h:%M}."
|
"{date:%m-%d-%Y %H:%M}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Vous ne pouvez plus envoyer vos notes de synthèse pour le second tour. "
|
"Vous ne pouvez plus envoyer vos notes de synthèse pour le second tour. "
|
||||||
"Deadline : {date:%d/%m/%Y %h:%M}."
|
"Deadline : {date:%d/%m/%Y %h:%M}."
|
||||||
|
Loading…
Reference in New Issue
Block a user