Skip to content

Commit

Permalink
handle the case when recipients is not str but unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
demo committed Nov 28, 2011
1 parent a6f7bd8 commit b74f691
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpdesk/lib.py
Expand Up @@ -61,6 +61,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b

t = None
try:
import pdb;pdb.set_trace()
t = EmailTemplate.objects.get(template_name__iexact=template_name, locale=locale)
except EmailTemplate.DoesNotExist:
pass
Expand Down Expand Up @@ -101,9 +102,8 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
"{{ ticket.ticket }} {{ ticket.title|safe }} %s" % t.subject
).render(context)

if type(recipients) == str:
if recipients.find(','):
recipients = recipients.split(',')
if isinstance(recipients,(str,unicode)):
recipients = recipients.split(',')
elif type(recipients) != list:
recipients = [recipients,]

Expand Down

0 comments on commit b74f691

Please sign in to comment.