From 1bb72cc68024995bca98925a5dc1709173c9c335 Mon Sep 17 00:00:00 2001 From: Romain Brucker Date: Thu, 28 Sep 2017 11:15:14 -0500 Subject: [PATCH] Adding a check to see if the color is 'None' before lowercasing it for @matburt --- awx/main/notifications/hipchat_backend.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/awx/main/notifications/hipchat_backend.py b/awx/main/notifications/hipchat_backend.py index 30e22ae07f..8997d74899 100644 --- a/awx/main/notifications/hipchat_backend.py +++ b/awx/main/notifications/hipchat_backend.py @@ -26,10 +26,13 @@ class HipChatBackend(AWXBaseEmailBackend): def __init__(self, token, color, api_url, notify, fail_silently=False, **kwargs): super(HipChatBackend, self).__init__(fail_silently=fail_silently) self.token = token - self.color = color + if color == 'None': + self.color = color + else: + self.color = color.lower() self.api_url = api_url self.notify = notify - + def send_messages(self, messages): sent_messages = 0 @@ -38,7 +41,7 @@ class HipChatBackend(AWXBaseEmailBackend): r = requests.post("{}/v2/room/{}/notification".format(self.api_url, rcp), params={"auth_token": self.token}, verify=False, - json={"color": self.color.lower(), + json={"color": self.color, "message": m.subject, "notify": self.notify, "from": m.from_email,