Private
Public Access
1
0

under armour & trainingpeaks done

This commit is contained in:
Sander Roosendaal
2018-07-04 13:30:30 +02:00
parent 8da86e610d
commit 45a6300c76
9 changed files with 271 additions and 25 deletions

View File

@@ -229,7 +229,6 @@ def uploadactivity(access_token,filename,description='',
data = json.dumps(data),
headers=headers)
print resp.status_code
if resp.status_code != 200:
if settings.DEBUG:
print resp.status_code
@@ -237,24 +236,11 @@ def uploadactivity(access_token,filename,description='',
print ""
print headers
print ""
with open("media/tperrors.log","a") as errorlog:
errorlog.write(str(resp.status_code))
errorlog.write("\r\n")
timestr = strftime("%Y%m%d-%H%M%S")
errorlog.write(timestr+"\r\n")
errorlog.write("\r\n")
errorlog.write(str(resp.reason))
errorlog.write("\r\n")
try:
errorlog.write(str(resp.json()))
except:
pass
errorlog.write("\r\n")
return 0,resp.reason,resp.status_code,headers
else:
return resp.json()[0]["Id"],"ok",200,""
return 0
return 0,0,0,0
def workout_tp_upload(user,w):