aboutsummaryrefslogtreecommitdiffstats
path: root/pysite
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-02-11 18:07:05 +0000
committerGravatar Gareth Coles <[email protected]>2018-02-11 18:07:05 +0000
commite22e50f16a9c45d3c26ca4f30c734740be80861d (patch)
treee1cec18cf07adbc5a26d2e7fb9a0d1dfeb63d411 /pysite
parent[Asana] Apparently not all stories have types? (diff)
[Asana] Apparently not all stories have types?
Diffstat (limited to 'pysite')
-rw-r--r--pysite/views/api/asana.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pysite/views/api/asana.py b/pysite/views/api/asana.py
index 944e5d8e..47c6aad8 100644
--- a/pysite/views/api/asana.py
+++ b/pysite/views/api/asana.py
@@ -87,7 +87,7 @@ class IndexView(APIView):
session = requests.session()
story = session.get(f"{STORY_URL}/{resource}").json()
- if story.get("type", None) == "comment" and action == "added": # New comment!
+ if story.get("type") == "comment" and action == "added": # New comment!
task = session.get(f"{TASK_URL}/{parent}").json()
user = session.get(f"{USER_URL}/{user}").json()
project = task["projects"][0] # Just use the first project in the list
@@ -113,7 +113,7 @@ class IndexView(APIView):
)
self.send_webhook(
- title=f"Unknown story action/type: {action}/{story['type']}",
+ title=f"Unknown story action/type: {action}/{story.get('type')}",
description=f"```json\n{pretty_story}\n```"
)
session.close()