more error tracing around Strava
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user