From 3e79336fc8f79f732024082b21c748a0ec48a5d0 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 1 Apr 2017 15:49:14 +0200 Subject: [PATCH] Strava import - imported time instead of distance --- rowers/stravastuff.py | 4 +--- rowers/views.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index 13c20463..5fd018c4 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -156,7 +156,6 @@ def get_strava_workout(user,stravaid): url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/heartrate?resolution="+fetchresolution+"&series_type="+series_type hrjson = requests.get(url,headers=headers) url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/time?resolution="+fetchresolution+"&series_type="+series_type - print url timejson = requests.get(url,headers=headers) url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/velocity_smooth?resolution="+fetchresolution+"&series_type="+series_type velojson = requests.get(url,headers=headers) @@ -167,7 +166,7 @@ def get_strava_workout(user,stravaid): try: t = np.array(timejson.json()[0]['data']) - d = np.array(distancejson.json()[0]['data']) + d = np.array(distancejson.json()[1]['data']) nr_rows = len(t) if nr_rows == 0: return (0,"Error: Time data had zero length") @@ -175,7 +174,6 @@ def get_strava_workout(user,stravaid): return (0,"something went wrong with the Strava import") try: - print spmjson.json() spm = np.array(spmjson.json()[1]['data']) except: spm = np.zeros(nr_rows) diff --git a/rowers/views.py b/rowers/views.py index d48fc436..cb8d3fc7 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -708,7 +708,6 @@ def add_workout_from_stdata(user,importid,data): title = "Imported data" - res = splitstdata(data['distance']) distance = res[1]