diff --git a/rowers/dataprep.py b/rowers/dataprep.py index f0849105..acb1ff77 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -572,9 +572,15 @@ def new_workout_from_file(r,f2, with zipfile.ZipFile(f2) as z: # for now, we're getting only the first file # from the NK zip file (issue #69 on bitbucket) - f2 = z.extract(z.namelist()[0],path='media/') - fileformat = fileformat[2] + for fname in z.namelist(): + f3 = z.extract(fname,path='media/') + id,message,f2 = new_workout_from_file(r,f3, + workouttype=workouttype, + makeprivate=makeprivate, + title = title, + notes='') os.remove(f_to_be_deleted) + return id,message,f2 # Some people try to upload Concept2 logbook summaries if fileformat == 'c2log': diff --git a/rowers/templates/400.html b/rowers/templates/400.html index caf15419..43d7e090 100644 --- a/rowers/templates/400.html +++ b/rowers/templates/400.html @@ -1,4 +1,4 @@ -{% extends "bases.html" %} +{% extends "base.html" %} {% load staticfiles %} {% load rowerfilters %} diff --git a/rowers/templates/403.html b/rowers/templates/403.html index fc4b11cf..316b4872 100644 --- a/rowers/templates/403.html +++ b/rowers/templates/403.html @@ -1,4 +1,4 @@ -{% extends "bases.html" %} +{% extends "base.html" %} {% load staticfiles %} {% load rowerfilters %} diff --git a/rowers/templates/404.html b/rowers/templates/404.html index 69d2b396..0116bd84 100644 --- a/rowers/templates/404.html +++ b/rowers/templates/404.html @@ -1,4 +1,4 @@ -{% extends "bases.html" %} +{% extends "base.html" %} {% load staticfiles %} {% load rowerfilters %} diff --git a/rowers/templates/500.html b/rowers/templates/500.html index cf988e28..258d606b 100644 --- a/rowers/templates/500.html +++ b/rowers/templates/500.html @@ -1,4 +1,4 @@ -{% extends "bases.html" %} +{% extends "base.html" %} {% load staticfiles %} {% load rowerfilters %} diff --git a/rowers/views.py b/rowers/views.py index e9d6c065..2a04bddd 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -5169,11 +5169,24 @@ def workout_upload_view(request,message="", request.session['uploadoptions'] = uploadoptions - - makeprivate = uploadoptions['makeprivate'] - make_plot = uploadoptions['make_plot'] - plottype = uploadoptions['plottype'] - upload_toc2 = uploadoptions['upload_to_C2'] + try: + makeprivate = uploadoptions['makeprivate'] + except KeyError: + makeprivate = False + try: + make_plot = uploadoptions['make_plot'] + except KeyError: + make_plot = False + + try: + plottype = uploadoptions['plottype'] + except KeyError: + plottype = 'timeplot' + + try: + upload_toc2 = uploadoptions['upload_to_C2'] + except KeyError: + upload_toc2 = False r = Rower.objects.get(user=request.user) if request.method == 'POST':