Private
Public Access
1
0

Code to check Strava behaviour

This commit is contained in:
Sander Roosendaal
2016-12-27 08:50:57 +01:00
parent 51c9915044
commit 6b20e1c936
2 changed files with 23 additions and 8 deletions

View File

@@ -934,9 +934,17 @@ def workout_strava_upload_view(request,id=0):
try:
with open(tcxfile,'rb') as f:
res = stravastuff.handle_stravaexport(f,w.name,
r.stravatoken,
description=w.notes)
try:
res = stravastuff.handle_stravaexport(f,w.name,
r.stravatoken,
description=w.notes)
except:
with open("media/stravaerrors.log","a") as errorlog:
errorstring = str(sys.exc_info()[0])
timestr = time.strftime("%Y%m%d-%H%M%S")
errorlog.write(timestr+errorstring+"\r\n")
errorlog.write("views.py line 946\r\n")
w.uploadedtostrava = res
w.save()