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 @@
- Click on session name to clone to current period -
| {% if ps.name != '' %} - {{ ps.name }} + {{ ps.name }} {% else %} - Unnamed Session + Unnamed Session {% endif %} | {{ ps.sessionvalue }} | 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)