From 9d4a629a42ab17144d7e238967e22206a71ed883 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 17 Nov 2019 17:49:11 +0100 Subject: [PATCH] bug fix --- rowers/views/workoutviews.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 7f06aa68..e164c70e 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -2450,7 +2450,12 @@ def workout_data_view(request, id=0): else: form = DataFrameColumnsForm(initial = {'cols':tcols}) - datadf = datadf[tcols] + try: + datadf = datadf[tcols] + except KeyError: + tcols = list(set(datadf.columns(tolist)+tcols)) + datadf = datadf[tcols] + datadf = datadf.fillna(value=0) for col in cols: try: