fixed email sending when no locale is specified in queue

This commit is contained in:
maccesch 2011-09-05 19:16:22 +02:00
parent c4fa11719f
commit 70a2cd9271

View File

@ -56,9 +56,11 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
context = Context(email_context)
locale = 'en';
if hasattr(context['queue'], 'locale'):
locale = getattr(context['queue'], 'locale', 'en')
locale = getattr(context['queue'], 'locale', '')
else:
locale = context['queue'].get('locale', 'en')
if not locale:
locale = 'en'
t = None
try: