added authorization link
This commit is contained in:
@@ -162,6 +162,9 @@
|
|||||||
<div class="grid_2">
|
<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>
|
<p><a href="/rowers/me/underarmourauthorize/"><img src="/static/img/UAbtn.png" alt="connect with Under Armour" width="120"></a></p>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -208,7 +208,8 @@ def tp_check(access_token):
|
|||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def uploadactivity(access_token,filename,description=''):
|
def uploadactivity(access_token,filename,description='',
|
||||||
|
name='Rowsandall.com workout'):
|
||||||
data_gz = BytesIO()
|
data_gz = BytesIO()
|
||||||
with file(filename,'rb') as inF:
|
with file(filename,'rb') as inF:
|
||||||
s = inF.read()
|
s = inF.read()
|
||||||
@@ -226,6 +227,8 @@ def uploadactivity(access_token,filename,description=''):
|
|||||||
"UploadClient": "rowsandall",
|
"UploadClient": "rowsandall",
|
||||||
"Filename": filename,
|
"Filename": filename,
|
||||||
"SetWorkoutPublic": True,
|
"SetWorkoutPublic": True,
|
||||||
|
"Title":name,
|
||||||
|
"Type": "rowing",
|
||||||
"Comment": description,
|
"Comment": description,
|
||||||
"Data": base64.b64encode(data_gz.getvalue()).decode("ascii")
|
"Data": base64.b64encode(data_gz.getvalue()).decode("ascii")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1230,7 +1230,7 @@ def workout_tp_upload_view(request,id=0):
|
|||||||
tcxfile = tpstuff.createtpworkoutdata(w)
|
tcxfile = tpstuff.createtpworkoutdata(w)
|
||||||
if tcxfile:
|
if tcxfile:
|
||||||
res = tpstuff.uploadactivity(r.tptoken,tcxfile,
|
res = tpstuff.uploadactivity(r.tptoken,tcxfile,
|
||||||
description=w.notes)
|
name=w.name)
|
||||||
if res == 0:
|
if res == 0:
|
||||||
message = "Upload to TrainingPeaks failed"
|
message = "Upload to TrainingPeaks failed"
|
||||||
w.uploadedtotp = -1
|
w.uploadedtotp = -1
|
||||||
|
|||||||
BIN
static/img/TP_logo_horz_2_color.png
Normal file
BIN
static/img/TP_logo_horz_2_color.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Reference in New Issue
Block a user