Fixing up some unicode issues

This commit is contained in:
Matthew Jones
2016-02-23 15:26:29 -05:00
parent 75ef0dd395
commit 4b1493f456
9 changed files with 36 additions and 20 deletions

View File

@@ -3,6 +3,7 @@
import logging
from django.utils.encoding import smart_text
from django.core.mail.backends.smtp import EmailBackend
class CustomEmailBackend(EmailBackend):
@@ -19,9 +20,9 @@ class CustomEmailBackend(EmailBackend):
sender_parameter = "sender"
def format_body(self, body):
body_actual = "{} #{} had status {} on Ansible Tower, view details at {}\n\n".format(body['friendly_name'],
body['id'],
body['status'],
body['url'])
body_actual = smart_text("{} #{} had status {} on Ansible Tower, view details at {}\n\n".format(body['friendly_name'],
body['id'],
body['status'],
body['url']))
body_actual += pprint.pformat(body, indent=4)
return body_actual