Private
Public Access
1
0

more error tracing around Strava

This commit is contained in:
Sander Roosendaal
2017-01-04 22:30:59 +01:00
parent f4c1812036
commit 0ca922f5a2
7 changed files with 207 additions and 11 deletions

View File

@@ -922,6 +922,7 @@ def workout_csvemail_view(request,id=0):
def workout_strava_upload_view(request,id=0):
message = ""
r = Rower.objects.get(user=request.user)
res = -1
if (r.stravatoken == '') or (r.stravatoken is None):
s = "Token doesn't exist. Need to authorize"
return HttpResponseRedirect("/rowers/me/stravaauthorize/")
@@ -929,9 +930,14 @@ def workout_strava_upload_view(request,id=0):
# ready to upload. Hurray
w = Workout.objects.get(id=id)
if (checkworkoutuser(request.user,w)):
tcxfile = stravastuff.createstravaworkoutdata(w)
try:
tcxfile = stravastuff.createstravaworkoutdata(w)
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")
try:
with open(tcxfile,'rb') as f:
try: