Permalink
Browse files

Merge pull request #1 from KristianOellegaard/develop

Convert everything to unicode strings before inserting to DB
  • Loading branch information...
2 parents 072df9c + ae91821 commit 5600fd575e69d12ddbc2a0af1551a3ba5c17a436 @stefanfoulis committed Mar 30, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 database_email_backend/backend.py
View
16 database_email_backend/backend.py
@@ -10,14 +10,14 @@ def send_messages(self, email_messages):
return
for message in email_messages:
email = Email.objects.create(
- from_email = message.from_email,
- to_emails = ', '.join(message.to),
- cc_emails = ', '.join(message.cc),
- bcc_emails = ', '.join(message.bcc),
- all_recipients = ', '.join(message.recipients()),
- subject = message.subject,
- body = message.body,
- raw = message.message().as_string()
+ from_email = u'%s' % message.from_email,
+ to_emails = u', '.join(message.to),
+ cc_emails = u', '.join(message.cc),
+ bcc_emails = u', '.join(message.bcc),
+ all_recipients = u', '.join(message.recipients()),
+ subject = u'%s' % message.subject,
+ body = u'%s' % message.body,
+ raw = u'%s' % message.message().as_string()
)
for attachment in message.attachments:
if isinstance(attachment, tuple):

0 comments on commit 5600fd5

Please sign in to comment.