From 4bc63cc37ee9ca1f8e5656387606c8e3ec18e417 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 22 Aug 2018 10:57:13 -0400 Subject: [PATCH] fix a bug that broke bot avatars for Slack notifications when a *color* is specified for a Slack notification template, we use the *web* not the RTM API; when you use a bot with the web API, you have to specify the `as_user=True` argument to have the message use the bot's name and avatar see: https://github.com/ansible/tower/issues/2883 see: https://github.com/ansible/awx/issues/2187 --- awx/main/notifications/slack_backend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/main/notifications/slack_backend.py b/awx/main/notifications/slack_backend.py index b68f91ef7c..603fe2f1c4 100644 --- a/awx/main/notifications/slack_backend.py +++ b/awx/main/notifications/slack_backend.py @@ -69,6 +69,7 @@ class SlackBackend(AWXBaseEmailBackend): r = r[1:] ret = connection.api_call("chat.postMessage", channel=r, + as_user=True, attachments=[{ "color": self.color, "text": m.subject