From 5d07cdc3703abb5af7a2f50214a35fa03e2a80e2 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 28 Aug 2020 21:20:48 +0200 Subject: [PATCH] auto adjusting workout type --- rowers/plannedsessions.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py index a5c5ffcc..a896b372 100644 --- a/rowers/plannedsessions.py +++ b/rowers/plannedsessions.py @@ -1501,11 +1501,6 @@ def add_workout_indoorrace(ws,race,r,recordid=0,doregister=False): ) - - - - - if race.sessionmode == 'distance': if ws[0].distance != race.sessionvalue: errors.append('Your workout did not have the correct distance') @@ -1659,13 +1654,15 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0,doregister=False): errors.append("Couldn't find this entry") return result,comments,errors,0 - if ws[0].workouttype not in mytypes.otwtypes: - errors.append('You have to submit a rowing on water workout') - return 0,comments,errors,0 + #if ws[0].workouttype not in mytypes.otwtypes: + # errors.append('You have to submit a rowing on water workout') + # return 0,comments,errors,0 if ws[0].workouttype != record.boatclass: - errors.append('Your workout boat class is different than on your race registration') - return 0,comments,errors,0 + ws[0].workouttype = record.boatclass + ws[0].save() + #errors.append('Your workout boat class is different than on your race registration') + #return 0,comments,errors,0 if ws[0].boattype != record.boattype: errors.append('Your workout boat type did not match the boat type you registered')