Merge branch 'develop' into feature/sensorfusion
This commit is contained in:
@@ -1665,6 +1665,13 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
xaxmax = datadf['distance'].max()
|
xaxmax = datadf['distance'].max()
|
||||||
xaxmin = datadf['distance'].min()
|
xaxmin = datadf['distance'].min()
|
||||||
|
|
||||||
|
if yparam == 'distance':
|
||||||
|
yaxmin = datadf['distance'].min()
|
||||||
|
yaxmax = datadf['distance'].max()
|
||||||
|
elif yparam == 'cumdist':
|
||||||
|
yaxmin = datadf['cumdist'].min()
|
||||||
|
yaxmax = datadf['cumdist'].max()
|
||||||
|
else:
|
||||||
yaxmin = yaxminima[yparam]
|
yaxmin = yaxminima[yparam]
|
||||||
yaxmax = yaxmaxima[yparam]
|
yaxmax = yaxmaxima[yparam]
|
||||||
|
|
||||||
|
|||||||
@@ -163,9 +163,12 @@ def get_strava_workout(user,stravaid):
|
|||||||
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/latlng?resolution="+fetchresolution
|
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/latlng?resolution="+fetchresolution
|
||||||
latlongjson = requests.get(url,headers=headers)
|
latlongjson = requests.get(url,headers=headers)
|
||||||
|
|
||||||
|
try:
|
||||||
t = np.array(timejson.json()[0]['data'])
|
t = np.array(timejson.json()[0]['data'])
|
||||||
d = np.array(distancejson.json()[0]['data'])
|
d = np.array(distancejson.json()[0]['data'])
|
||||||
nr_rows = len(t)
|
nr_rows = len(t)
|
||||||
|
except KeyError:
|
||||||
|
return (0,"something went wrong with the Strava import")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
spm = np.array( spmjson.json()[1]['data'])
|
spm = np.array( spmjson.json()[1]['data'])
|
||||||
|
|||||||
@@ -1164,7 +1164,16 @@ def rower_process_twittercallback(request):
|
|||||||
# Process Strava Callback
|
# Process Strava Callback
|
||||||
@login_required()
|
@login_required()
|
||||||
def rower_process_stravacallback(request):
|
def rower_process_stravacallback(request):
|
||||||
|
try:
|
||||||
code = request.GET['code']
|
code = request.GET['code']
|
||||||
|
except MultiValueDictKeyError:
|
||||||
|
try:
|
||||||
|
message = request.GET['error']
|
||||||
|
except MultiValueDictKeyError:
|
||||||
|
message = "access error"
|
||||||
|
|
||||||
|
return imports_view(request,message=message)
|
||||||
|
|
||||||
res = stravastuff.get_token(code)
|
res = stravastuff.get_token(code)
|
||||||
|
|
||||||
if res[0]:
|
if res[0]:
|
||||||
@@ -4453,6 +4462,10 @@ def workout_c2import_view(request,message=""):
|
|||||||
# Import a workout from Strava
|
# Import a workout from Strava
|
||||||
@login_required()
|
@login_required()
|
||||||
def workout_getstravaworkout_view(request,stravaid):
|
def workout_getstravaworkout_view(request,stravaid):
|
||||||
|
res = stravastuff.get_strava_workout(request.user,stravaid)
|
||||||
|
if not res[0]:
|
||||||
|
message = "Something went wrong in Strava import"
|
||||||
|
return imports_view(request,message=message)
|
||||||
|
|
||||||
strokedata = res[1]
|
strokedata = res[1]
|
||||||
data = res[0]
|
data = res[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user