diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py index c69d530d..8db47a02 100644 --- a/rowers/plannedsessions.py +++ b/rowers/plannedsessions.py @@ -1056,11 +1056,19 @@ def create_sessions_from_json(plansteps,athletes,startdate,manager): trainingdays = plansteps['trainingDays'] for day in trainingdays: for workout in day['workouts']: + print(workout['sport']) + print(mytypes.fitmappinginv[workout['sport'].lower()]) + sessionsport = 'water' + try: + sessionsport = mytypes.fitmappinginv[workout['sport'].lower()] + except KeyError: + pass + ps = PlannedSession( startdate = startdate+timedelta(days=day['order']), enddate = startdate, preferreddate = startdate, - sessionsport = 'water', # change this + sessionsport = sessionsport, # change this name = workout['workoutName'], steps = workout, manager = manager, diff --git a/rowers/templates/instantplan.html b/rowers/templates/instantplan.html index df55e69a..0295251a 100644 --- a/rowers/templates/instantplan.html +++ b/rowers/templates/instantplan.html @@ -9,7 +9,7 @@
Created by: {{ plan.owner.first_name }} {{ plan.owner.last_name }}
{% if plan.url %}Link: @@ -23,7 +23,25 @@
{{ plan.hoursperweek }} hours per week
{{ plan.sessionsperweek }} sessions per week
+ When you submit this form, a training plan will be created based on {{ plan.name }}, ending at your target date, + and the sessions will be copied to your session calendar. +
++ You can select the end date manually or use the training target (if you have any), and the plan will start at + the date it needs to complete in time. +
+ +- When you submit this form, a training plan will be created based on {{ plan.name }}, ending at your target date, - and the sessions will be copied to your session calendar. -
-- You can select the end date manually or use the training target (if you have any), and the plan will start at - the date it needs to complete in time. -
- -