Private
Public Access
1
0

sporttracks callback

This commit is contained in:
Sander Roosendaal
2017-05-11 20:49:57 +02:00
parent 0ae926536f
commit f03892f1c7
3 changed files with 16 additions and 11 deletions

View File

@@ -1170,12 +1170,12 @@ def workout_tp_upload_view(request,id=0):
if (checkworkoutuser(request.user,w)):
tcxfile = tpstuff.createtpworkoutdata(w)
if tcxfile:
res,reason,status_code,headers = tpstuff.uploadactivity(r.tptoken,tcxfile,
name=w.name)
res,reason,status_code,headers = tpstuff.uploadactivity(
r.tptoken,tcxfile,
name=w.name
)
if res == 0:
message = "Upload to TrainingPeaks failed with status code "+str(status_code)+": "+reason
w.uploadedtotp = -1
w.save()
try:
os.remove(tcxfile)
except WindowsError: