diff options
| author | Alban Gruin | 2017-01-29 11:55:15 +0100 | 
|---|---|---|
| committer | Alban Gruin | 2017-01-29 11:55:15 +0100 | 
| commit | b4ede7e76773d0ca39d4cc999d0ddc353151ac5d (patch) | |
| tree | 9171216f6d8badbfb2371afe04dc7bd3945ed263 /management/commands | |
| parent | 009bdf1468b4d7c977f125535e59a5c89731fc4f (diff) | |
Traduction de la date dans les mails
Diffstat (limited to 'management/commands')
| -rw-r--r-- | management/commands/sendmails.py | 4 | 
1 files changed, 3 insertions, 1 deletions
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()  | 
