mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -03: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())
|
||||
for m in messages:
|
||||
r = requests.post("{}".format(m.recipients()[0]),
|
||||
data=json.dumps(m.body),
|
||||
json=m.body,
|
||||
headers=self.headers)
|
||||
if r.status_code >= 400:
|
||||
logger.error(smart_text("Error sending notification webhook: {}".format(r.text)))
|
||||
|
||||
Reference in New Issue
Block a user