From 6382e305856d2f2136aefe78b2ba4bbb2b64f691 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 15 Mar 2021 21:00:39 +0100 Subject: [PATCH] adding description to step notes --- rowers/plannedsessions.py | 2 +- rowers/utils.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py index 997fa5d9..c69d530d 100644 --- a/rowers/plannedsessions.py +++ b/rowers/plannedsessions.py @@ -1053,7 +1053,7 @@ def get_workouts_session(r,ps): return ws def create_sessions_from_json(plansteps,athletes,startdate,manager): - trainingdays = plansteps['plan']['trainingDays'] + trainingdays = plansteps['trainingDays'] for day in trainingdays: for workout in day['workouts']: ps = PlannedSession( diff --git a/rowers/utils.py b/rowers/utils.py index ec6efdba..8c48c7a4 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -977,12 +977,17 @@ def step_to_string(step): name = step['wkt_step_name'] + try: + notes = ' - '+step['description'] + except KeyError: + notes = '' + try: intensity = step['intensity'] except KeyError: intensity = 0 - s = '{name} {intensity} {duration} {unit} {target} {repeat}'.format( + s = '{name} {intensity} {duration} {unit} {target} {repeat} {notes}'.format( nr = nr, name = name, unit=unit, @@ -990,6 +995,7 @@ def step_to_string(step): duration = duration, target=target, repeat = repeat, + notes=notes, ) if type == 'RepeatStep':