Private
Public Access
1
0

Merge branch 'develop' into feature/autostrava

This commit is contained in:
Sander Roosendaal
2018-06-25 17:24:37 +02:00
3 changed files with 21 additions and 10 deletions

View File

@@ -41,6 +41,11 @@ from stravalib.exc import ActivityUploadFailed,TimeoutExceeded
from rowsandall_app.settings import C2_CLIENT_ID, C2_REDIRECT_URI, C2_CLIENT_SECRET, STRAVA_CLIENT_ID, STRAVA_REDIRECT_URI, STRAVA_CLIENT_SECRET
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
# Exponentially weighted moving average
# Used for data smoothing of the jagged data obtained by Strava
# See bitbucket issue 72
@@ -109,7 +114,7 @@ def get_token(code):
try:
token_json = response.json()
thetoken = token_json['access_token']
except KeyError:
except (KeyError,JSONDecodeError):
thetoken = 0
return [thetoken]