Private
Public Access
1
0

added authorization link

This commit is contained in:
Sander Roosendaal
2017-04-21 15:05:59 +02:00
parent 3b6591c6ae
commit 35ce1c7049
4 changed files with 8 additions and 2 deletions

View File

@@ -162,6 +162,9 @@
<div class="grid_2">
<p><a href="/rowers/me/underarmourauthorize/"><img src="/static/img/UAbtn.png" alt="connect with Under Armour" width="120"></a></p>
</div>
<div class="grid_2 omega">
<p><a href="/rowers/me/tpauthorize/"><img src="/static/img/TP_logo_horz_2_color.png" alt="connect with TrainingPeaks" width="150"></a></p>
</div>
</div>
</div>

View File

@@ -208,7 +208,8 @@ def tp_check(access_token):
return resp
def uploadactivity(access_token,filename,description=''):
def uploadactivity(access_token,filename,description='',
name='Rowsandall.com workout'):
data_gz = BytesIO()
with file(filename,'rb') as inF:
s = inF.read()
@@ -226,6 +227,8 @@ def uploadactivity(access_token,filename,description=''):
"UploadClient": "rowsandall",
"Filename": filename,
"SetWorkoutPublic": True,
"Title":name,
"Type": "rowing",
"Comment": description,
"Data": base64.b64encode(data_gz.getvalue()).decode("ascii")
}

View File

@@ -1230,7 +1230,7 @@ def workout_tp_upload_view(request,id=0):
tcxfile = tpstuff.createtpworkoutdata(w)
if tcxfile:
res = tpstuff.uploadactivity(r.tptoken,tcxfile,
description=w.notes)
name=w.name)
if res == 0:
message = "Upload to TrainingPeaks failed"
w.uploadedtotp = -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB