From e3b5cc1aa8cb4007d683c4afe5f9947541c33616 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 25 Oct 2017 11:29:19 +0200 Subject: [PATCH] bug fix, and some additions Reviewed bug allowing database to be queried on non-existing columns. Looks like a freak bug and code to prevent it was already in place. Not sure what happened to trigger the bug on the production server. Wait for another occurence, then solve. Added Flex Chart as a button on the left panel. Added Workflow configuration to the User Settings page --- rowers/interactiveplots.py | 5 ++++- rowers/templates/favoritecharts.html | 2 +- rowers/templates/panel_flexchart.html | 5 +++++ rowers/templates/rower_form.html | 10 +++++++++- rowers/utils.py | 1 + rowers/views.py | 1 - 6 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 rowers/templates/panel_flexchart.html diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 60cad3cc..dff5c227 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -2170,7 +2170,10 @@ def interactive_flex_chart2(id=0,promember=0, if yparam1 == 'pace': y_axis_type = 'datetime' - y1mean = rowdata.ix[:,'pace'].mean() + try: + y1mean = rowdata.ix[:,'pace'].mean() + except KeyError: + y1mean = 0 rowdata['xname'] = axlabels[xparam] diff --git a/rowers/templates/favoritecharts.html b/rowers/templates/favoritecharts.html index efe81047..d8c52704 100644 --- a/rowers/templates/favoritecharts.html +++ b/rowers/templates/favoritecharts.html @@ -6,7 +6,7 @@
{% csrf_token %}
-
+

diff --git a/rowers/templates/panel_flexchart.html b/rowers/templates/panel_flexchart.html new file mode 100644 index 00000000..a82261bb --- /dev/null +++ b/rowers/templates/panel_flexchart.html @@ -0,0 +1,5 @@ +
+

+ Flex Chart +

+
diff --git a/rowers/templates/rower_form.html b/rowers/templates/rower_form.html index da9029a4..4f06fc9e 100644 --- a/rowers/templates/rower_form.html +++ b/rowers/templates/rower_form.html @@ -170,7 +170,7 @@
-
+

Export Settings

@@ -178,6 +178,14 @@

+
+

+

Configure Workflow Layout

+ +

+
diff --git a/rowers/utils.py b/rowers/utils.py index 27133bf5..71f23547 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -35,6 +35,7 @@ workflowleftpanel = ( ('panel_advancededit.html','Advanced Workout Edit Button'), ('panel_editintervals.html','Edit Intervals Button'), ('panel_stats.html','Workout Statistics Button'), + ('panel_flexchart.html','Flex Chart'), ('panel_staticchart.html','Create Static Charts Buttons'), ('panel_geekyheader.html','Geeky Header'), ('panel_editwind.html','Edit Wind Data'), diff --git a/rowers/views.py b/rowers/views.py index 5ce1156b..cdaed4ca 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -8555,7 +8555,6 @@ def rower_favoritecharts_view(request): if favorites_formset.is_valid(): new_instances = [] for favorites_form in favorites_formset: - print 'mies' yparam1 = favorites_form.cleaned_data.get('yparam1') yparam2 = favorites_form.cleaned_data.get('yparam2') xparam = favorites_form.cleaned_data.get('xparam')