diff options
| author | 2018-02-11 18:55:47 +0000 | |
|---|---|---|
| committer | 2018-02-11 18:55:47 +0000 | |
| commit | f5eb81a06e4c092a3b5e0db7e6db88854abd9471 (patch) | |
| tree | d80294b7ca67c5100cc7d90557bbc87d54d023d8 | |
| parent | F821: Undefined name (diff) | |
[Asana] Asana wraps everything in a "data" key for some reason
| -rw-r--r-- | pysite/views/api/asana.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/pysite/views/api/asana.py b/pysite/views/api/asana.py index bb6f51f9..c02320df 100644 --- a/pysite/views/api/asana.py +++ b/pysite/views/api/asana.py @@ -95,11 +95,11 @@ class IndexView(APIView):          if story.get("type") == "comment" and action == "added":  # New comment!              resp = session.get(f"{TASK_URL}/{parent}")              resp.raise_for_status() -            task = resp.json() +            task = resp.json()["data"]              resp = session.get(f"{USER_URL}/{user}")              resp.raise_for_status() -            user = resp.json() +            user = resp.json()["data"]              if user.get("photo"):                  photo = user["photo"]["image_128x128"] @@ -146,7 +146,7 @@ class IndexView(APIView):          resp = session.get(f"{TASK_URL}/{resource}")          resp.raise_for_status() -        task = resp.json() +        task = resp.json()["data"]          if action == "changed":  # New comment!              if not user: | 
