From fd10f14660d21f4cc5753c5e3ef59a7819ebe4c8 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 17 Feb 2017 07:37:31 +0100 Subject: [PATCH] removing some strava error catching code - I want tracebacks --- rowers/views.py | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/rowers/views.py b/rowers/views.py index 46f4321f..9250f6c0 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -797,30 +797,21 @@ def workout_strava_upload_view(request,id=0): tcxfile = stravastuff.createstravaworkoutdata(w) if tcxfile: with open(tcxfile,'rb') as f: - try: - res = stravastuff.handle_stravaexport(f,w.name, + res = stravastuff.handle_stravaexport(f,w.name, r.stravatoken, description=w.notes) - if res==0: - message = "Strava Upload error: %s" % e - w.uploadedtostrava = -1 - w.save() - os.remove(tcxfile) - url = reverse(workout_export_view, - kwargs = { - 'id':str(w.id), - }) - response = HttpResponseRedirect(url) - return response + if res==0: + message = "Strava Upload error: %s" % e + w.uploadedtostrava = -1 + w.save() + os.remove(tcxfile) + url = reverse(workout_export_view, + kwargs = { + 'id':str(w.id), + }) + response = HttpResponseRedirect(url) + return response - except: - with open("media/stravaerrors.log","a") as errorlog: - errorstring = str(sys.exc_info()[0]) - timestr = strftime("%Y%m%d-%H%M%S") - errorlog.write(timestr+errorstring+"\r\n") - errorlog.write("views.py line 937\r\n") - message = 'Error: '+errorstring - res = 0 try: w.uploadedtostrava = res w.save() @@ -832,7 +823,7 @@ def workout_strava_upload_view(request,id=0): errorstring = str(sys.exc_info()[0]) timestr = strftime("%Y%m%d-%H%M%S") errorlog.write(timestr+errorstring+"\r\n") - errorlog.write("views.py line 952\r\n") + errorlog.write("views.py line 826\r\n") message = 'Error: '+errorstring else: message = "Strava Upload error"