Fix an issue with the email notifier

Incorrect body format assumptions in the email notifier
This commit is contained in:
Matthew Jones 2016-03-21 15:40:41 -04:00
parent edabf23c6a
commit f286dc7486

View File

@ -20,9 +20,12 @@ class CustomEmailBackend(EmailBackend):
sender_parameter = "sender"
def format_body(self, body):
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)
if "body" in body:
body_actual = body['body']
else:
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