Private
Public Access
1
0

disallowing wrong boat class

This commit is contained in:
Sander Roosendaal
2018-12-09 18:19:03 +01:00
parent 0e2961fbe2
commit de69e76aa2
2 changed files with 12 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ def get_indoorraces(workout):
registrations = IndoorVirtualRaceResult.objects.filter(
race__in = races,
boatclass = workout.workouttype,
userid=workout.user.id)
races = [r.race for r in registrations]
@@ -1008,7 +1009,10 @@ def add_workout_indoorrace(ws,race,r,recordid=0):
record.distance = ws[0].distance
record.duration = ws[0].duration
if ws[0].workouttype != record.boatclass:
errors.append('Your workout boat class is different than on your race registration')
return 0,comments,errors,0
if ws[0].workouttype not in mytypes.otetypes:
errors.append('You must submit a indoor rowing workout')
return 0,comments, errors, 0
@@ -1109,6 +1113,9 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
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
if ws[0].boattype != record.boattype:
errors.append('Your workout boat type did not match the boat type you registered')