Hi All,

I have a function that sends mail to managers every time a new tag is
created, connected to post_save of a Tag model via dispatcher.

def mail_new_tag(instance):
    t = loader.get_template('app/new_tag_email.txt')
    c = Context({'tag': instance})
    msg = t.render(c)
    sbj = u'new tag: %s' % (instance.name)
    mail_managers(subject=sbj, message=msg)

This works fine when the instance.name is all ascii, but when it
contains non-ascii characters, a UnicodeDecodeError is raised.

When debugging, I see that instance.name is a unicode object, but,
"sbj" cannot be rendered.

Thanks for any help,
oMat


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to