From eab60762b609708243b362c944d7e574b9e1be20 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 12 Jun 2018 20:02:21 +0200 Subject: [PATCH] hotfix flexall data --- rowers/views.py | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/rowers/views.py b/rowers/views.py index acf450f5..c6e9e46a 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -2981,21 +2981,38 @@ def cum_flex_data( 'deltadays':-1, }): + def_options = options + if 'options' in request.session: options = request.session['options'] - workouttypes = options['workouttypes'] - rankingonly = options['rankingonly'] - includereststrokes = options['includereststrokes'] - waterboattype = options['waterboattype'] - workstrokesonly = not includereststrokes - theuser = options['theuser'] - xparam = options['xparam'] - yparam1 = options['yparam1'] - yparam2 = options['yparam2'] - startdatestring = options['startdatestring'] - enddatestring = options['enddatestring'] - deltadays = options['deltadays'] + try: + workouttypes = options['workouttypes'] + rankingonly = options['rankingonly'] + includereststrokes = options['includereststrokes'] + waterboattype = options['waterboattype'] + workstrokesonly = not includereststrokes + theuser = options['theuser'] + xparam = options['xparam'] + yparam1 = options['yparam1'] + yparam2 = options['yparam2'] + startdatestring = options['startdatestring'] + enddatestring = options['enddatestring'] + deltadays = options['deltadays'] + except KeyError: + workouttypes = def_options['workouttypes'] + rankingonly = def_options['rankingonly'] + includereststrokes = def_options['includereststrokes'] + waterboattype = def_options['waterboattype'] + workstrokesonly = not includereststrokes + theuser = def_options['theuser'] + xparam = def_options['xparam'] + yparam1 = def_options['yparam1'] + yparam2 = def_options['yparam2'] + startdatestring = def_options['startdatestring'] + enddatestring = def_options['enddatestring'] + deltadays = def_options['deltadays'] + try: @@ -3047,7 +3064,7 @@ def cum_flex_data( yparam2=yparam2, promember=promember, workstrokesonly=workstrokesonly, - rankingpiece__in=rankingpiece) + ) script = res[0] div = res[1] else: @@ -3629,7 +3646,7 @@ def addmanual_view(request): try: rankingpiece = form.cleaned_data['rankingpiece'] except KeyError: - rankingpiece =- Workout.objects.get(id=id).rankingpiece + rankingpiece = False if private: privacy = 'private'