mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-04-30 15:44:26 +02:00
handle the case when recipients is not str but unicode
This commit is contained in:
parent
a6f7bd8a25
commit
b74f6914b2
@ -61,6 +61,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
|
|
||||||
t = None
|
t = None
|
||||||
try:
|
try:
|
||||||
|
import pdb;pdb.set_trace()
|
||||||
t = EmailTemplate.objects.get(template_name__iexact=template_name, locale=locale)
|
t = EmailTemplate.objects.get(template_name__iexact=template_name, locale=locale)
|
||||||
except EmailTemplate.DoesNotExist:
|
except EmailTemplate.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
@ -101,9 +102,8 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
"{{ ticket.ticket }} {{ ticket.title|safe }} %s" % t.subject
|
"{{ ticket.ticket }} {{ ticket.title|safe }} %s" % t.subject
|
||||||
).render(context)
|
).render(context)
|
||||||
|
|
||||||
if type(recipients) == str:
|
if isinstance(recipients,(str,unicode)):
|
||||||
if recipients.find(','):
|
recipients = recipients.split(',')
|
||||||
recipients = recipients.split(',')
|
|
||||||
elif type(recipients) != list:
|
elif type(recipients) != list:
|
||||||
recipients = [recipients,]
|
recipients = [recipients,]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user