improved race uploading
This commit is contained in:
@@ -25,6 +25,8 @@ from rowers.models import (
|
||||
|
||||
from rowers.courses import get_time_course
|
||||
|
||||
import rowers.mytypes as mytypes
|
||||
|
||||
import metrics
|
||||
import numpy as np
|
||||
import dataprep
|
||||
@@ -35,7 +37,6 @@ from rowers.tasks import handle_check_race_course
|
||||
|
||||
def get_indoorraces(workout):
|
||||
races1 = VirtualRace.objects.filter(
|
||||
registration_closure__gt=timezone.now(),
|
||||
sessiontype='indoorrace',
|
||||
startdate__lte=workout.date,
|
||||
enddate__gte=workout.date,
|
||||
@@ -48,7 +49,6 @@ def get_indoorraces(workout):
|
||||
|
||||
|
||||
races2 = VirtualRace.objects.filter(
|
||||
registration_closure__gt=timezone.now(),
|
||||
sessiontype='indoorrace',
|
||||
startdate__lte=workout.date,
|
||||
enddate__gte=workout.date,
|
||||
@@ -1009,6 +1009,9 @@ def add_workout_indoorrace(ws,race,r,recordid=0):
|
||||
record.duration = ws[0].duration
|
||||
|
||||
|
||||
if ws[0].workouttype not in mytypes.otetypes:
|
||||
errors.append('You must submit a indoor rowing workout')
|
||||
return 0,comments, errors, 0
|
||||
|
||||
if ws[0].weightcategory != record.weightcategory:
|
||||
errors.append('Your workout weight category did not match the weight category you registered')
|
||||
@@ -1102,6 +1105,11 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
||||
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].boattype != record.boattype:
|
||||
errors.append('Your workout boat type did not match the boat type you registered')
|
||||
return 0,comments,errors,0
|
||||
|
||||
Reference in New Issue
Block a user