mirror of
https://github.com/ansible/awx.git
synced 2026-04-04 17:55:06 -02:30
Force requests to emit application/json
When sending webhook notifications
This commit is contained in:
@@ -32,7 +32,7 @@ class WebhookBackend(TowerBaseEmailBackend):
|
|||||||
self.headers['User-Agent'] = "Tower {}".format(get_awx_version())
|
self.headers['User-Agent'] = "Tower {}".format(get_awx_version())
|
||||||
for m in messages:
|
for m in messages:
|
||||||
r = requests.post("{}".format(m.recipients()[0]),
|
r = requests.post("{}".format(m.recipients()[0]),
|
||||||
data=json.dumps(m.body),
|
json=m.body,
|
||||||
headers=self.headers)
|
headers=self.headers)
|
||||||
if r.status_code >= 400:
|
if r.status_code >= 400:
|
||||||
logger.error(smart_text("Error sending notification webhook: {}".format(r.text)))
|
logger.error(smart_text("Error sending notification webhook: {}".format(r.text)))
|
||||||
|
|||||||
Reference in New Issue
Block a user