ui/django-post_office — pull request #10 by leporo (2013-03-29 08:42:56+00:00)
Title: Allow unicode messages to be displayed in Django Administration

I've got this error trying to display a list of emails containing unicode characters in their message body:

File "..../python2.7/site-packages/post_office/admin.py", line 7, in get_message_preview
return ('{0}...'.format(instance.message[:25]) if len(instance.message) > 25

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128)

The issue seem quite easy to fix by replacing the '{0}...' ASCII string with the same unicode text.

This patch just adds the 'u' marker to the ''{0}...' string.

Thank you.