mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Adding a check to see if the color is 'None' before lowercasing it for @matburt
This commit is contained in:
@@ -26,7 +26,10 @@ class HipChatBackend(AWXBaseEmailBackend):
|
|||||||
def __init__(self, token, color, api_url, notify, fail_silently=False, **kwargs):
|
def __init__(self, token, color, api_url, notify, fail_silently=False, **kwargs):
|
||||||
super(HipChatBackend, self).__init__(fail_silently=fail_silently)
|
super(HipChatBackend, self).__init__(fail_silently=fail_silently)
|
||||||
self.token = token
|
self.token = token
|
||||||
self.color = color
|
if color == 'None':
|
||||||
|
self.color = color
|
||||||
|
else:
|
||||||
|
self.color = color.lower()
|
||||||
self.api_url = api_url
|
self.api_url = api_url
|
||||||
self.notify = notify
|
self.notify = notify
|
||||||
|
|
||||||
@@ -38,7 +41,7 @@ class HipChatBackend(AWXBaseEmailBackend):
|
|||||||
r = requests.post("{}/v2/room/{}/notification".format(self.api_url, rcp),
|
r = requests.post("{}/v2/room/{}/notification".format(self.api_url, rcp),
|
||||||
params={"auth_token": self.token},
|
params={"auth_token": self.token},
|
||||||
verify=False,
|
verify=False,
|
||||||
json={"color": self.color.lower(),
|
json={"color": self.color,
|
||||||
"message": m.subject,
|
"message": m.subject,
|
||||||
"notify": self.notify,
|
"notify": self.notify,
|
||||||
"from": m.from_email,
|
"from": m.from_email,
|
||||||
|
|||||||
Reference in New Issue
Block a user