fix
This commit is contained in:
@@ -1470,7 +1470,7 @@ def default_class(r,w,race):
|
||||
adaptiveclass = w.adaptiveclass
|
||||
weightclass = w.weightcategory
|
||||
else:
|
||||
if race.sessiontype == 'race':
|
||||
if race.sessiontype in ['race','fastest_time','fastest_meters']:
|
||||
boatclass = 'water'
|
||||
else:
|
||||
boatclass = 'rower'
|
||||
@@ -1486,9 +1486,11 @@ def default_class(r,w,race):
|
||||
boattype=boattype,
|
||||
weightclass=weightclass,
|
||||
sex=sex,
|
||||
standardcollection = race.coursestandards,
|
||||
).order_by("agemax","-agemin","boattype","sex")
|
||||
|
||||
|
||||
|
||||
if standards.count()==0:
|
||||
# omit weight
|
||||
standards = CourseStandard.objects.filter(
|
||||
@@ -1497,33 +1499,41 @@ def default_class(r,w,race):
|
||||
adaptiveclass=adaptiveclass,
|
||||
boattype=boattype,
|
||||
sex=sex,
|
||||
standardcollection = race.coursestandards,
|
||||
).order_by(
|
||||
"agemax","-agemin","boattype","sex","weightclass",
|
||||
"referencespeed"
|
||||
)
|
||||
|
||||
if standards.count()==0:
|
||||
# omit adaptive class
|
||||
standards = CourseStandard.objects.filter(
|
||||
agemin__lt=age,agemax__gt=age,
|
||||
boattype=boattype,sex=sex,
|
||||
standardcollection = race.coursestandards,
|
||||
).order_by(
|
||||
"agemax","-agemin","boattype","sex",
|
||||
"weightclass","referencespeed")
|
||||
|
||||
if standards.count()==0:
|
||||
# omit boattype
|
||||
standards = CourseStandard.objects.filter(
|
||||
agemin__lt=age,agemax__gt=age,sex=sex,
|
||||
standardcollection = race.coursestandards,
|
||||
).order_by(
|
||||
"agemax","-agemin","boattype","sex",
|
||||
"weightclass","referencespeed")
|
||||
|
||||
if standards.count()==0:
|
||||
# omit boattype
|
||||
standards = CourseStandard.objects.filter(
|
||||
agemin__lt=age,agemax__gt=age,sex='male',
|
||||
standardcollection = race.coursestandards
|
||||
).order_by(
|
||||
"agemax","-agemin","boattype","sex",
|
||||
"weightclass","referencespeed")
|
||||
|
||||
|
||||
if standards.count()==0:
|
||||
# boolean, boattype, boatclass, adaptiveclass, weightclass, sex, coursestandard,
|
||||
return False,'1x','water',None,'hwt','male',5.0,None
|
||||
|
||||
Reference in New Issue
Block a user