From a10e9b46f6c8d91278e717db024c234d8f0123e1 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 23 Jul 2014 01:31:11 +0200 Subject: [PATCH] fix locale --- teleforma/management/commands/teleforma-exam-message-bug.py | 4 ++-- .../management/commands/teleforma-exam-submit-scripts.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/teleforma/management/commands/teleforma-exam-message-bug.py b/teleforma/management/commands/teleforma-exam-message-bug.py index 1143c048..c906caba 100644 --- a/teleforma/management/commands/teleforma-exam-message-bug.py +++ b/teleforma/management/commands/teleforma-exam-message-bug.py @@ -4,14 +4,14 @@ from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.template.defaultfilters import slugify +from django.utils import translation +from django.conf import settings from telemeta.models import * from telemeta.util.unaccent import unaccent from teleforma.exam.models import * import logging import codecs import time, os -from django.utils import translation -from django.conf import settings class Command(BaseCommand): diff --git a/teleforma/management/commands/teleforma-exam-submit-scripts.py b/teleforma/management/commands/teleforma-exam-submit-scripts.py index 47d610fd..69942cb4 100644 --- a/teleforma/management/commands/teleforma-exam-submit-scripts.py +++ b/teleforma/management/commands/teleforma-exam-submit-scripts.py @@ -4,6 +4,8 @@ from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.template.defaultfilters import slugify +from django.utils import translation +from django.conf import settings from telemeta.models import * from telemeta.util.unaccent import unaccent from teleforma.exam.models import * @@ -29,6 +31,7 @@ class Command(BaseCommand): args = "log_file" def handle(self, *args, **options): + translation.activate(settings.LANGUAGE_CODE) logger = Logger(args[0]) for script in Script.objects.filter(status=2): logger.logger.info(script.title) -- 2.39.5