mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-02-22 21:31:03 +01:00
* Bugfix on previous
This commit is contained in:
parent
065e7e9eb0
commit
25e978f68c
10
lib.py
10
lib.py
@ -54,19 +54,19 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
context = Context(email_context)
|
context = Context(email_context)
|
||||||
locale = getattr(context['queue'], 'locale', 'en')
|
locale = getattr(context['queue'], 'locale', 'en')
|
||||||
|
|
||||||
if locale != 'en':
|
if locale:
|
||||||
template_localized = template_name + ':' + locale
|
template_localized = template_name + ':' + locale
|
||||||
else:
|
else:
|
||||||
template_localized = None
|
template_localized = None
|
||||||
|
|
||||||
got_template = True
|
t = None
|
||||||
if template_localized:
|
if template_localized:
|
||||||
try:
|
try:
|
||||||
t = EmailTemplate.objects.get(templaet_name__iexact=template_localized)
|
t = EmailTemplate.objects.get(template_name__iexact=template_localized)
|
||||||
except EmailTemplate.DoesNotExist:
|
except EmailTemplate.DoesNotExist:
|
||||||
got_template = False
|
pass
|
||||||
|
|
||||||
if not got_template:
|
if not t:
|
||||||
t = EmailTemplate.objects.get(template_name__iexact=template_name)
|
t = EmailTemplate.objects.get(template_name__iexact=template_name)
|
||||||
|
|
||||||
if not sender:
|
if not sender:
|
||||||
|
Loading…
Reference in New Issue
Block a user