small bug fixes
This commit is contained in:
@@ -38,6 +38,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
|
||||
@@ -106,7 +111,7 @@ def get_token(code):
|
||||
try:
|
||||
token_json = response.json()
|
||||
thetoken = token_json['access_token']
|
||||
except KeyError:
|
||||
except (KeyError,JSONDecodeError):
|
||||
thetoken = 0
|
||||
|
||||
return [thetoken]
|
||||
|
||||
Reference in New Issue
Block a user