Private
Public Access
1
0

fixed strava import errors

This commit is contained in:
Sander Roosendaal
2017-03-09 12:58:28 +01:00
parent 350720029d
commit a98a9b1178
2 changed files with 20 additions and 4 deletions

View File

@@ -163,9 +163,12 @@ def get_strava_workout(user,stravaid):
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/latlng?resolution="+fetchresolution
latlongjson = requests.get(url,headers=headers)
t = np.array(timejson.json()[0]['data'])
d = np.array(distancejson.json()[0]['data'])
nr_rows = len(t)
try:
t = np.array(timejson.json()[0]['data'])
d = np.array(distancejson.json()[0]['data'])
nr_rows = len(t)
except KeyError:
return (0,"something went wrong with the Strava import")
try:
spm = np.array( spmjson.json()[1]['data'])