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
|
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
|
# Exponentially weighted moving average
|
||||||
# Used for data smoothing of the jagged data obtained by Strava
|
# Used for data smoothing of the jagged data obtained by Strava
|
||||||
# See bitbucket issue 72
|
# See bitbucket issue 72
|
||||||
@@ -106,7 +111,7 @@ def get_token(code):
|
|||||||
try:
|
try:
|
||||||
token_json = response.json()
|
token_json = response.json()
|
||||||
thetoken = token_json['access_token']
|
thetoken = token_json['access_token']
|
||||||
except KeyError:
|
except (KeyError,JSONDecodeError):
|
||||||
thetoken = 0
|
thetoken = 0
|
||||||
|
|
||||||
return [thetoken]
|
return [thetoken]
|
||||||
|
|||||||
@@ -1409,8 +1409,11 @@ def add_workout_from_runkeeperdata(user,importid,data):
|
|||||||
|
|
||||||
|
|
||||||
unixtime = cum_time+starttimeunix
|
unixtime = cum_time+starttimeunix
|
||||||
unixtime[0] = starttimeunix
|
try:
|
||||||
|
unixtime[0] = starttimeunix
|
||||||
|
except IndexError:
|
||||||
|
return (0,'No data to import')
|
||||||
|
|
||||||
df['TimeStamp (sec)'] = unixtime
|
df['TimeStamp (sec)'] = unixtime
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user