Add webhook notification backend

This commit is contained in:
Matthew Jones
2016-02-10 17:03:57 -05:00
parent 34ebe0a848
commit 7abcb6e306
3 changed files with 39 additions and 4 deletions

View File

@@ -39,8 +39,9 @@ class HipChatBackend(BaseEmailBackend):
"notify": self.notify,
"from": m.from_email,
"message_format": "text"})
if r.status_code != 204 and not self.fail_silently:
if r.status_code != 204:
logger.error("Error sending messages: {}".format(r.text))
raise Exception("Error sending message to hipchat: {}".format(r.text))
sent_messages += 1
if not self.fail_silently:
raise Exception("Error sending message to hipchat: {}".format(r.text))
sent_messages += 1
return sent_messages