From b4ede7e76773d0ca39d4cc999d0ddc353151ac5d Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 29 Jan 2017 11:55:15 +0100 Subject: Traduction de la date dans les mails --- management/commands/sendmails.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/management/commands/sendmails.py b/management/commands/sendmails.py index b42d3d5..a134d80 100644 --- a/management/commands/sendmails.py +++ b/management/commands/sendmails.py @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand, CommandError from django.core.mail import send_mass_mail -from django.utils import timezone +from django.utils import timezone, translation from django.template import Context, loader from django.conf import settings @@ -14,6 +14,8 @@ class Command(BaseCommand): help = "Sends emails to subscribed users" def handle(self, *args, **options): + translation.activate(settings.LANGUAGE_CODE) + year, week, day = timezone.now().isocalendar() if day >= 6: year, week, _ = (timezone.now() + datetime.timedelta(weeks=1)).isocalendar() -- cgit v1.2.1