mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-02 19:39:14 +01:00
Handle context['queue'] as a dict or an object
See: GH-70 - https://github.com/rossp/django-helpdesk/pull/70
This commit is contained in:
parent
6e33408a7d
commit
0661fc995d
@ -54,7 +54,15 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
||||
import os
|
||||
|
||||
context = Context(email_context)
|
||||
locale = context['queue'].get('locale', 'en')
|
||||
|
||||
# XXX: context['queue'] seems to able to be provided as either
|
||||
# a dict or a Queue object, handle both & fallback to 'en'
|
||||
if isinstance(context['queue'], dict):
|
||||
locale = context['queue'].get('locale', 'en')
|
||||
elif hasattr(context['queue'], 'locale'):
|
||||
locale = context['queue'].locale
|
||||
else:
|
||||
locale = 'en'
|
||||
|
||||
t = None
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user