disallowing wrong boat class
This commit is contained in:
@@ -61,6 +61,7 @@ def get_indoorraces(workout):
|
|||||||
|
|
||||||
registrations = IndoorVirtualRaceResult.objects.filter(
|
registrations = IndoorVirtualRaceResult.objects.filter(
|
||||||
race__in = races,
|
race__in = races,
|
||||||
|
boatclass = workout.workouttype,
|
||||||
userid=workout.user.id)
|
userid=workout.user.id)
|
||||||
|
|
||||||
races = [r.race for r in registrations]
|
races = [r.race for r in registrations]
|
||||||
@@ -1008,6 +1009,9 @@ def add_workout_indoorrace(ws,race,r,recordid=0):
|
|||||||
record.distance = ws[0].distance
|
record.distance = ws[0].distance
|
||||||
record.duration = ws[0].duration
|
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:
|
if ws[0].workouttype not in mytypes.otetypes:
|
||||||
errors.append('You must submit a indoor rowing workout')
|
errors.append('You must submit a indoor rowing workout')
|
||||||
@@ -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')
|
errors.append('You have to submit a rowing on water workout')
|
||||||
return 0,comments,errors,0
|
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:
|
if ws[0].boattype != record.boattype:
|
||||||
errors.append('Your workout boat type did not match the boat type you registered')
|
errors.append('Your workout boat type did not match the boat type you registered')
|
||||||
|
|||||||
@@ -335,6 +335,8 @@ data-text="@rowsandall #rowingdata Participate in Indoor Rowing virtual race '{{
|
|||||||
{% if race.sessiontype == 'race' %}
|
{% if race.sessiontype == 'race' %}
|
||||||
<th>Class</th>
|
<th>Class</th>
|
||||||
<th>Boat</th>
|
<th>Boat</th>
|
||||||
|
{% else %}
|
||||||
|
<th>Class</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th>Age</th>
|
<th>Age</th>
|
||||||
<th>Gender</th>
|
<th>Gender</th>
|
||||||
@@ -348,6 +350,8 @@ data-text="@rowsandall #rowingdata Participate in Indoor Rowing virtual race '{{
|
|||||||
{% if race.sessiontype == 'race' %}
|
{% if race.sessiontype == 'race' %}
|
||||||
<td>{{ record.boatclass }}</td>
|
<td>{{ record.boatclass }}</td>
|
||||||
<td>{{ record.boattype }}</td>
|
<td>{{ record.boattype }}</td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ record.boatclass }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>{{ record.age }}</td>
|
<td>{{ record.age }}</td>
|
||||||
<td>{{ record.sex }}</td>
|
<td>{{ record.sex }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user