diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index 23bf374f..676c724d 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -351,7 +351,12 @@ def get_token(code): token_json = response.json() - if token_json['status_code'] == 200: + try: + status_code = token_json['status_code'] + except KeyError: + status_code = token_json.status_code + + if status_code == 200: thetoken = token_json['access_token'] expires_in = token_json['expires_in'] refresh_token = token_json['refresh_token']