From 2110b6e7b13d17b3a6a2ca7448b3d92f7b794c12 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 15 Feb 2017 19:28:15 +0100 Subject: [PATCH 1/3] added blank line adding blank lines is good --- rowsandall_app/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rowsandall_app/settings.py b/rowsandall_app/settings.py index 6f61935d..81a166df 100644 --- a/rowsandall_app/settings.py +++ b/rowsandall_app/settings.py @@ -269,6 +269,7 @@ EMAIL_USE_TLS = CFG['email_use_tls'] #EMAIL_USE_TLS = False DEFAULT_FROM_EMAIL = 'admin@rowsandall.com' + # weather stuff FORECAST_IO_KEY = CFG['forecast_io_key'] From b1379f8295f89460f04880d05f9a6b3746a3b044 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 16 Feb 2017 09:25:15 +0100 Subject: [PATCH 2/3] added tcx file export error check --- rowers/views.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rowers/views.py b/rowers/views.py index b18410b2..d561c448 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -685,12 +685,20 @@ def workout_tcxemail_view(request,id=0): if (checkworkoutuser(request.user,w)): try: tcxfile = stravastuff.createstravaworkoutdata(w) - if settings.DEBUG: + if tcxfile == 0: + message = "Something went wrong (TCX export)" + url = reverse(workout_export_view, + kwargs = { + 'id':str(w.id), + 'message':message, + }) + return HttpResponseRedirect(url) + if settings.DEBUG and tcxfile: res = handle_sendemailtcx.delay(r.user.first_name, r.user.last_name, r.user.email,tcxfile) - else: + elif tcxfile: res = queuehigh.enqueue(handle_sendemailtcx,r.user.first_name, r.user.last_name, r.user.email,tcxfile) From 993cf6128ab04eaaab80b3be68d08b43979ae59b Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 16 Feb 2017 15:14:24 +0100 Subject: [PATCH 3/3] bugfix - automatic chart creation on non-painsled upload --- rowers/dataprep.py | 2 +- rowers/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 0b16e99f..15e76a0c 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -483,7 +483,7 @@ def new_workout_from_file(r,f2, dosummary=dosummary, title=title) - return (id,message) + return (id,message,f2) # Compare the data from the CSV file and the database # Currently only calculates number of strokes. To be expanded with diff --git a/rowers/views.py b/rowers/views.py index d561c448..9731e9e9 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -4241,7 +4241,7 @@ def workout_upload_view(request,message="", f2 = res[1] # file name incl media directory - id,message = dataprep.new_workout_from_file(r,f2, + id,message,f2 = dataprep.new_workout_from_file(r,f2, workouttype=workouttype, makeprivate=makeprivate, title = t,