From 9e459b1bb32ea088cd09b9a037f9278cdd5ad969 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 5 Mar 2021 14:42:47 +0100 Subject: [PATCH] f --- rowers/templates/plannedsessiontemplateedit.html | 9 ++------- rowers/utils.py | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/rowers/templates/plannedsessiontemplateedit.html b/rowers/templates/plannedsessiontemplateedit.html index dc84e128..1a7456bf 100644 --- a/rowers/templates/plannedsessiontemplateedit.html +++ b/rowers/templates/plannedsessiontemplateedit.html @@ -37,9 +37,6 @@
  • Library

    -

    - Click on session name to clone to current period -

    @@ -55,11 +52,9 @@ diff --git a/rowers/utils.py b/rowers/utils.py index 2269d9de..a20a1333 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -919,9 +919,18 @@ def step_to_string(step): ph = pacestringhigh, ) elif targettype == 'Cadence': - value = step['targetValue'] - valuelow = step['targetValueLow'] - valuehigh = step['targetValueHigh'] + try: + value = step['targetValue'] + except KeyError: + value = 0 + try: + valuelow = step['targetValueLow'] + except KeyError: + valuelow = 0 + try: + valuehigh = step['targetValueHigh'] + except KeyError: + valuehigh = 0 if value != 0: target = 'Target: Cadence at {v} SPM'.format(v=value)
    {% if ps.name != '' %} - {{ ps.name }} + {{ ps.name }} {% else %} - Unnamed Session + Unnamed Session {% endif %} {{ ps.sessionvalue }}