fixed strava import errors
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user