started registration form processing on OTW events - not working yet
This commit is contained in:
@@ -1631,6 +1631,40 @@ def virtualevent_register_view(request,id=0):
|
||||
if sex == 'not specified':
|
||||
sex = 'male'
|
||||
|
||||
|
||||
coursestandard = None
|
||||
referencespeed = 5.0
|
||||
|
||||
if race.coursestandards is not None:
|
||||
coursestandard = cd['entrycategory']
|
||||
referencespeed = coursestandard.referencespeed
|
||||
boattype = coursestandard.boattype
|
||||
boatclass = coursestandard.boatclass
|
||||
weightcategory = coursestandard.weightcategory
|
||||
adaptiveclass = coursestandard.adaptiveclass
|
||||
skillclass = coursestandard.skillclass
|
||||
|
||||
returnurl = reverse(virtualevent_register_view,
|
||||
kwargs={'id':race.id})
|
||||
|
||||
if age < coursestandard.agemin:
|
||||
messages.error(request,'You are younger than the minimum age for this group')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
if age > coursestandard.agemax:
|
||||
messages.error(request,'You are older than the maximum age for this group')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
if sex == 'male' and coursestandard.sex != 'male':
|
||||
messages.error(request,'Men are not allowed to enter this category')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
||||
messages.error(request,'Mixed crews are not allowed to enter this category')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
|
||||
record = VirtualRaceResult(
|
||||
userid=r.id,
|
||||
teamname=teamname,
|
||||
@@ -1646,7 +1680,8 @@ def virtualevent_register_view(request,id=0):
|
||||
boattype=boattype,
|
||||
coursecompleted=False,
|
||||
sex=sex,
|
||||
age=age
|
||||
age=age,
|
||||
entrycategory=coursestandard,
|
||||
)
|
||||
|
||||
record.save()
|
||||
|
||||
Reference in New Issue
Block a user