messages for upload
This commit is contained in:
@@ -283,7 +283,6 @@ def uploadactivity(access_token,filename,description='',
|
||||
with open("media/tperrors.log","a") as errorlog:
|
||||
errorlog.write(str(resp.status_code))
|
||||
errorlog.write("\r\n")
|
||||
print "noot"
|
||||
timestr = strftime("%Y%m%d-%H%M%S")
|
||||
errorlog.write(timestr+"\r\n")
|
||||
errorlog.write("\r\n")
|
||||
@@ -296,14 +295,13 @@ def uploadactivity(access_token,filename,description='',
|
||||
errorlog.write("\r\n")
|
||||
return 0,resp.reason,resp.status_code,headers
|
||||
else:
|
||||
print resp.json()
|
||||
return resp.json()[0]["Id"],"ok",200,""
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def workout_tp_upload(user,w):
|
||||
message = ""
|
||||
message = "Uploading to TrainingPeaks"
|
||||
tpid = 0
|
||||
r = w.user
|
||||
|
||||
@@ -333,7 +331,7 @@ def workout_tp_upload(user,w):
|
||||
tpid = res
|
||||
w.save()
|
||||
os.remove(tcxfile)
|
||||
return '',tpid
|
||||
return 'Successfully synchronized to TrainingPeaks',tpid
|
||||
|
||||
else: # no tcxfile
|
||||
message = "Upload to TrainingPeaks failed"
|
||||
|
||||
Reference in New Issue
Block a user