diff --git a/participation/models.py b/participation/models.py index 2838dd9..c3bc7af 100644 --- a/participation/models.py +++ b/participation/models.py @@ -13,6 +13,7 @@ from django.urls import reverse_lazy from django.utils import timezone from django.utils.crypto import get_random_string from django.utils.text import format_lazy +from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ import gspread from gspread.utils import a1_range_to_grid_range, MergeType @@ -109,7 +110,7 @@ class Team(models.Model): text = _("Registrations for the tournament of {tournament} are ending on the {date:%Y-%m-%d %H:%M}.") content = format_lazy(text, tournament=self.participation.tournament.name, - date=self.participation.tournament.inscription_limit) + date=localtime(self.participation.tournament.inscription_limit)) informations.append({ 'title': _("Registrations closure"), 'type': "info", @@ -715,7 +716,7 @@ class Participation(models.Model): "We suggest to send at least {min_solutions} different solutions.
" "You can upload your solutions on your participation page.
") url = reverse_lazy("participation:participation_detail", args=(self.pk,)) - content = format_lazy(text, tournament=self.tournament.name, date=self.tournament.solution_limit, + content = format_lazy(text, tournament=self.tournament.name, date=localtime(self.tournament.solution_limit), nb_solutions=self.solutions.count(), min_solutions=len(settings.PROBLEMS) - 3, url=url) informations.append({ @@ -728,7 +729,8 @@ class Participation(models.Model): text = _("The draw of the solutions for the tournament {tournament} is planned on the " "{date:%Y-%m-%d %H:%M}. You can join it on this link.
") url = reverse_lazy("draw:index") - content = format_lazy(text, tournament=self.tournament.name, date=self.tournament.solutions_draw, url=url) + content = format_lazy(text, tournament=self.tournament.name, + date=localtime(self.tournament.solutions_draw), url=url) informations.append({ 'title': _("Draw of solutions"), 'type': "info", diff --git a/registration/models.py b/registration/models.py index 2da3334..0a10fcf 100644 --- a/registration/models.py +++ b/registration/models.py @@ -14,6 +14,7 @@ from django.utils.crypto import get_random_string from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from django.utils.text import format_lazy +from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ from phonenumber_field.modelfields import PhoneNumberField from polymorphic.models import PolymorphicModel @@ -471,7 +472,7 @@ class VolunteerRegistration(Registration): text = _("Registrations for tournament {tournament} are closing on {date:%Y-%m-%d %H:%M}. " "There are for now {validated_teams} validated teams (+ {pending_teams} pending) " "on {max_teams} expected.") - content = format_lazy(text, tournament=tournament.name, date=tournament.inscription_limit, + content = format_lazy(text, tournament=tournament.name, date=localtime(tournament.inscription_limit), validated_teams=tournament.participations.filter(valid=True).count(), pending_teams=tournament.participations.filter(valid=False).count(), max_teams=tournament.max_teams) @@ -517,7 +518,8 @@ class VolunteerRegistration(Registration): text = _("The draw of the solutions for the tournament {tournament} is planned on the " "{date:%Y-%m-%d %H:%M}. You can join it on this link.
") url = reverse_lazy("draw:index") - content = format_lazy(text, tournament=self.tournament.name, date=self.tournament.solutions_draw, + content = format_lazy(text, tournament=self.tournament.name, + date=localtime(self.tournament.solutions_draw), url=url) informations.append({ 'title': _("Draw of solutions"),