mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 04:00:06 -03:30
Change email notification formatting.
Instead of pretty printing the datastructure we'll now dump out the result in json format with indent=4 for pretty viewing.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2016 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import pprint
|
||||
import json
|
||||
|
||||
from django.utils.encoding import smart_text
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
@@ -16,5 +16,5 @@ class TowerBaseEmailBackend(BaseEmailBackend):
|
||||
body['id'],
|
||||
body['status'],
|
||||
body['url']))
|
||||
body_actual += pprint.pformat(body, indent=4)
|
||||
body_actual += json.dumps(body, indent=4)
|
||||
return body_actual
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2016 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import pprint
|
||||
import json
|
||||
|
||||
from django.utils.encoding import smart_text
|
||||
from django.core.mail.backends.smtp import EmailBackend
|
||||
@@ -27,5 +27,5 @@ class CustomEmailBackend(EmailBackend):
|
||||
body['id'],
|
||||
body['status'],
|
||||
body['url']))
|
||||
body_actual += pprint.pformat(body, indent=4)
|
||||
body_actual += json.dumps(body, indent=4)
|
||||
return body_actual
|
||||
|
||||
Reference in New Issue
Block a user