aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/api/asana.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-02-11 17:16:08 +0000
committerGravatar Gareth Coles <[email protected]>2018-02-11 17:16:08 +0000
commitcbabb0e46bd85ae08b2e3d8f1f246bcdddbb11fd (patch)
tree1f5c044c753ac1691d5a3bc351348f61751f559c /pysite/views/api/asana.py
parentAsana integration (#7) (diff)
Slightly more verbose logging
Diffstat (limited to 'pysite/views/api/asana.py')
-rw-r--r--pysite/views/api/asana.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pysite/views/api/asana.py b/pysite/views/api/asana.py
index ca9c5624..11f38ea7 100644
--- a/pysite/views/api/asana.py
+++ b/pysite/views/api/asana.py
@@ -23,11 +23,18 @@ class IndexView(APIView):
def post(self, asana_key):
if asana_key != ASANA_KEY:
+ self.send_webhook(
+ title="Asana",
+ description=f"Key verification failed\nExpected: `{ASANA_KEY}`\nGot: `{asana_key}`",
+ color=COLOUR_RED
+ )
+
return self.error(ErrorCodes.unauthorized)
if "X-Hook-Secret" in request.headers: # Confirm to Asana that we would like to make this hook
response = make_response() # type: flask.Response
response.headers["X-Hook-Secret"] = request.headers["X-Hook-Secret"]
+ self.send_webhook(title="Asana", description="Hook added", color=COLOUR_GREEN)
return response
events = request.get_json()["events"]