Merge branch 'release/v2.34'
This commit is contained in:
@@ -954,12 +954,12 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
y_axis_type = 'datetime'
|
y_axis_type = 'datetime'
|
||||||
y1mean = datadf.ix[:,'pace'].mean()
|
y1mean = datadf.ix[:,'pace'].mean()
|
||||||
|
|
||||||
datadf['xname'] = xparam
|
datadf['xname'] = axlabels[xparam]
|
||||||
datadf['yname1'] = yparam1
|
datadf['yname1'] = axlabels[yparam1]
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
datadf['yname2'] = yparam2
|
datadf['yname2'] = axlabels[yparam2]
|
||||||
else:
|
else:
|
||||||
datadf['yname2'] = yparam1
|
datadf['yname2'] = axlabels[yparam1]
|
||||||
|
|
||||||
|
|
||||||
source = ColumnDataSource(
|
source = ColumnDataSource(
|
||||||
@@ -1292,12 +1292,12 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
y1mean = rowdata.ix[:,'pace'].mean()
|
y1mean = rowdata.ix[:,'pace'].mean()
|
||||||
|
|
||||||
|
|
||||||
rowdata['xname'] = xparam
|
rowdata['xname'] = axlabels[xparam]
|
||||||
rowdata['yname1'] = yparam1
|
rowdata['yname1'] = axlabels[yparam1]
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
rowdata['yname2'] = yparam2
|
rowdata['yname2'] = axlabels[yparam2]
|
||||||
else:
|
else:
|
||||||
rowdata['yname2'] = yparam1
|
rowdata['yname2'] = axlabels[yparam1]
|
||||||
|
|
||||||
# prepare data
|
# prepare data
|
||||||
source = ColumnDataSource(
|
source = ColumnDataSource(
|
||||||
|
|||||||
@@ -245,9 +245,9 @@ def uploadactivity(access_token,filename,description='',
|
|||||||
print ""
|
print ""
|
||||||
print headers
|
print headers
|
||||||
print ""
|
print ""
|
||||||
return 0
|
return 0,"ok",200
|
||||||
else:
|
else:
|
||||||
return resp.json()[0]["Id"]
|
return resp.json()[0]["Id"],resp.reason,resp.status_code
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -1230,10 +1230,10 @@ def workout_tp_upload_view(request,id=0):
|
|||||||
message = ""
|
message = ""
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
res = -1
|
res = -1
|
||||||
try:
|
# try:
|
||||||
thetoken = tp_open(r.user)
|
thetoken = tp_open(r.user)
|
||||||
except TPNoTokenError:
|
# except TPNoTokenError:
|
||||||
return HttpResponseRedirect("/rowers/me/tpauthorize/")
|
# return HttpResponseRedirect("/rowers/me/tpauthorize/")
|
||||||
|
|
||||||
# ready to upload. Hurray
|
# ready to upload. Hurray
|
||||||
try:
|
try:
|
||||||
@@ -1244,10 +1244,10 @@ def workout_tp_upload_view(request,id=0):
|
|||||||
if (checkworkoutuser(request.user,w)):
|
if (checkworkoutuser(request.user,w)):
|
||||||
tcxfile = tpstuff.createtpworkoutdata(w)
|
tcxfile = tpstuff.createtpworkoutdata(w)
|
||||||
if tcxfile:
|
if tcxfile:
|
||||||
res = tpstuff.uploadactivity(r.tptoken,tcxfile,
|
res,reason,status_code = tpstuff.uploadactivity(r.tptoken,tcxfile,
|
||||||
name=w.name)
|
name=w.name)
|
||||||
if res == 0:
|
if res == 0:
|
||||||
message = "Upload to TrainingPeaks failed"
|
message = "Upload to TrainingPeaks failed with status code "+status_code+": "+reason
|
||||||
w.uploadedtotp = -1
|
w.uploadedtotp = -1
|
||||||
w.save()
|
w.save()
|
||||||
try:
|
try:
|
||||||
@@ -1817,7 +1817,6 @@ def rower_tp_token_refresh(request):
|
|||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
res = tpstuff.do_refresh_token(
|
res = tpstuff.do_refresh_token(
|
||||||
r.tprefreshtoken,
|
r.tprefreshtoken,
|
||||||
r.tptoken
|
|
||||||
)
|
)
|
||||||
access_token = res[0]
|
access_token = res[0]
|
||||||
expires_in = res[1]
|
expires_in = res[1]
|
||||||
|
|||||||
@@ -246,8 +246,7 @@ UNDERARMOUR_REDIRECT_URI = "http://rowsandall.com/underarmour_callback"
|
|||||||
# TrainingPeaks
|
# TrainingPeaks
|
||||||
TP_CLIENT_ID = CFG["tp_client_id"]
|
TP_CLIENT_ID = CFG["tp_client_id"]
|
||||||
TP_CLIENT_SECRET = CFG["tp_client_secret"]
|
TP_CLIENT_SECRET = CFG["tp_client_secret"]
|
||||||
TP_REDIRECT_URI = "http://rowsandall.com/tp_callback"
|
TP_REDIRECT_URI = CFG["tp_redirect_uri"]
|
||||||
#TP_REDIRECT_URI = "http://localhost:8000/tp_callback"
|
|
||||||
TP_CLIENT_KEY = TP_CLIENT_ID
|
TP_CLIENT_KEY = TP_CLIENT_ID
|
||||||
|
|
||||||
# RQ stuff
|
# RQ stuff
|
||||||
|
|||||||
Reference in New Issue
Block a user