Merge branch 'release/v12.71'
This commit is contained in:
@@ -1552,7 +1552,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
|||||||
|
|
||||||
job = myqueue(queue,handle_check_race_course,ws[0].csvfilename,
|
job = myqueue(queue,handle_check_race_course,ws[0].csvfilename,
|
||||||
ws[0].id,race.course.id,record.id,splitsecond=splitsecond,
|
ws[0].id,race.course.id,record.id,splitsecond=splitsecond,
|
||||||
# referencespeed=record.referencespeed,coursedistance=race.course.distance
|
referencespeed=record.referencespeed,coursedistance=race.course.distance
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from rowers.models import (
|
from rowers.models import (
|
||||||
#StandardCollection,CourseStandard,
|
StandardCollection,CourseStandard,
|
||||||
VirtualRaceResult,IndoorVirtualRaceResult,
|
VirtualRaceResult,IndoorVirtualRaceResult,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -353,15 +353,15 @@ def handle_check_race_course(self,
|
|||||||
else:
|
else:
|
||||||
splitsecond = 0
|
splitsecond = 0
|
||||||
|
|
||||||
# if 'referencespeed' in kwargs:
|
if 'referencespeed' in kwargs:
|
||||||
# referencespeed = kwargs['referencespeed']
|
referencespeed = kwargs['referencespeed']
|
||||||
# else:
|
else:
|
||||||
# referencespeed = 5.0
|
referencespeed = 5.0
|
||||||
|
|
||||||
# if 'coursedistance' in kwargs:
|
if 'coursedistance' in kwargs:
|
||||||
# coursedistance = kwargs['coursedistance']
|
coursedistance = kwargs['coursedistance']
|
||||||
# else:
|
else:
|
||||||
# coursedistance = 0
|
coursedistance = 0
|
||||||
|
|
||||||
mode = 'race'
|
mode = 'race'
|
||||||
if 'mode' in kwargs:
|
if 'mode' in kwargs:
|
||||||
@@ -489,30 +489,28 @@ def handle_check_race_course(self,
|
|||||||
else:
|
else:
|
||||||
coursecompleted = False
|
coursecompleted = False
|
||||||
|
|
||||||
# points = 0
|
points = 0
|
||||||
if coursecompleted:
|
if coursecompleted:
|
||||||
# if coursedistance == 0:
|
if coursedistance == 0:
|
||||||
# coursedistance = coursemeters
|
coursedistance = coursemeters
|
||||||
# velo = coursedistance/coursetimeseconds
|
velo = coursedistance/coursetimeseconds
|
||||||
# points = int(100*(2.-referencespeed/velo))
|
points = int(100*(2.-referencespeed/velo))
|
||||||
# query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||||
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
|
||||||
recordid=recordid,
|
recordid=recordid,
|
||||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||||
distance=int(coursemeters),
|
distance=int(coursemeters),
|
||||||
# points=points,
|
points=points,
|
||||||
workoutid=workoutid,
|
workoutid=workoutid,
|
||||||
startsecond=startsecond,
|
startsecond=startsecond,
|
||||||
endsecond=endsecond,
|
endsecond=endsecond,
|
||||||
)
|
)
|
||||||
|
|
||||||
if mode == 'coursetest':
|
if mode == 'coursetest':
|
||||||
# query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||||
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
|
||||||
recordid=recordid,
|
recordid=recordid,
|
||||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||||
distance=int(coursemeters),
|
distance=int(coursemeters),
|
||||||
# points=points,
|
points=points,
|
||||||
workoutid=workoutid,
|
workoutid=workoutid,
|
||||||
startsecond=startsecond,
|
startsecond=startsecond,
|
||||||
endsecond=endsecond,
|
endsecond=endsecond,
|
||||||
|
|||||||
@@ -133,13 +133,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% comment %}
|
|
||||||
<li id="standards">
|
<li id="standards">
|
||||||
<a href="/rowers/list-standards/">
|
<a href="/rowers/list-standards/">
|
||||||
<i class="fas fa-award fa-fw"></i> Course Time Standards
|
<i class="fas fa-award fa-fw"></i> Course Time Standards
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endcomment %}
|
|
||||||
</ul> <!-- cd-accordion-menu -->
|
</ul> <!-- cd-accordion-menu -->
|
||||||
|
|
||||||
{% include 'menuscript.html' %}
|
{% include 'menuscript.html' %}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
as a Male crew. Check the "Mixed gender" check box to register as a
|
as a Male crew. Check the "Mixed gender" check box to register as a
|
||||||
mixed gender crew (except for 1x where this check box does nothing).
|
mixed gender crew (except for 1x where this check box does nothing).
|
||||||
</p>
|
</p>
|
||||||
{% comment %}
|
|
||||||
{% if race.coursestandards %}
|
{% if race.coursestandards %}
|
||||||
<p>This race uses standard times and limits the race groups to those where
|
<p>This race uses standard times and limits the race groups to those where
|
||||||
standard times exist. The "Group" form choice will overrule other selections you
|
standard times exist. The "Group" form choice will overrule other selections you
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
You can check the valid race groups and standard times <a target="_" href="/rowers/standards/{{ race.coursestandards.id }}/">here</a>.
|
You can check the valid race groups and standard times <a target="_" href="/rowers/standards/{{ race.coursestandards.id }}/">here</a>.
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcomment %}
|
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
|
|||||||
@@ -67,8 +67,13 @@ def get_token(code):
|
|||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post("https://oauth.trainingpeaks.com/oauth/token",
|
try:
|
||||||
data=post_data)
|
response = requests.post(
|
||||||
|
"https://oauth.trainingpeaks.com/oauth/token",
|
||||||
|
data=post_data
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
return 0,0,0
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1127,10 +1127,10 @@ def virtualevent_view(request,id=0):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
adaptiveclass = ['None','PR1','PR2','PR3','FES']
|
adaptiveclass = ['None','PR1','PR2','PR3','FES']
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# entrycategory = cd['entrycategory']
|
entrycategory = cd['entrycategory']
|
||||||
# except KeyError:
|
except KeyError:
|
||||||
# entrycategory = None
|
entrycategory = None
|
||||||
|
|
||||||
if race.sessiontype == 'race':
|
if race.sessiontype == 'race':
|
||||||
results = resultobj.objects.filter(
|
results = resultobj.objects.filter(
|
||||||
@@ -1156,8 +1156,8 @@ def virtualevent_view(request,id=0):
|
|||||||
age__lte=age_max,
|
age__lte=age_max,
|
||||||
).order_by("duration","-distance")
|
).order_by("duration","-distance")
|
||||||
|
|
||||||
# if entrycategory is not None:
|
if entrycategory is not None:
|
||||||
# results = results.filter(entrycategory__in=entrycategory)
|
results = results.filter(entrycategory__in=entrycategory)
|
||||||
|
|
||||||
# to-do - add DNS
|
# to-do - add DNS
|
||||||
dns = []
|
dns = []
|
||||||
@@ -1479,10 +1479,10 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
except VirtualRace.DoesNotExist:
|
except VirtualRace.DoesNotExist:
|
||||||
raise Http404("Virtual Challenge does not exist")
|
raise Http404("Virtual Challenge does not exist")
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
|
|
||||||
if not race_can_adddiscipline(r,race):
|
if not race_can_adddiscipline(r,race):
|
||||||
@@ -1508,7 +1508,7 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
# we're still here
|
# we're still here
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
# process form
|
# process form
|
||||||
form = VirtualRaceResultForm(request.POST) #,categories=categories)
|
form = VirtualRaceResultForm(request.POST,categories=categories)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
cd = form.cleaned_data
|
cd = form.cleaned_data
|
||||||
teamname = cd['teamname']
|
teamname = cd['teamname']
|
||||||
@@ -1530,7 +1530,7 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
if sex == 'not specified':
|
if sex == 'not specified':
|
||||||
sex = 'male'
|
sex = 'male'
|
||||||
|
|
||||||
if boattype in boattypes and boatclass in boatclasses: # and race.coursestandards is None:
|
if boattype in boattypes and boatclass in boatclasses and race.coursestandards is None:
|
||||||
# check if different sexes
|
# check if different sexes
|
||||||
therecords = records.filter(
|
therecords = records.filter(
|
||||||
boattype=boattype,
|
boattype=boattype,
|
||||||
@@ -1551,47 +1551,47 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
|
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
# coursestandard = None
|
coursestandard = None
|
||||||
# referencespeed = 5.0
|
referencespeed = 5.0
|
||||||
|
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# coursestandard = cd['entrycategory']
|
coursestandard = cd['entrycategory']
|
||||||
# thegroups = [record.entrycategory for record in records]
|
thegroups = [record.entrycategory for record in records]
|
||||||
# if coursestandard in thegroups:
|
if coursestandard in thegroups:
|
||||||
# messages.error(request,"You have already registered in that group")
|
messages.error(request,"You have already registered in that group")
|
||||||
# url = reverse('virtualevent_view',
|
url = reverse('virtualevent_view',
|
||||||
# kwargs = {
|
kwargs = {
|
||||||
# 'id': race.id
|
'id': race.id
|
||||||
# }
|
}
|
||||||
# )
|
)
|
||||||
|
|
||||||
# return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
# referencespeed = coursestandard.referencespeed
|
referencespeed = coursestandard.referencespeed
|
||||||
# boattype = coursestandard.boattype
|
boattype = coursestandard.boattype
|
||||||
# boatclass = coursestandard.boatclass
|
boatclass = coursestandard.boatclass
|
||||||
# weightcategory = coursestandard.weightclass
|
weightcategory = coursestandard.weightclass
|
||||||
# adaptiveclass = coursestandard.adaptiveclass
|
adaptiveclass = coursestandard.adaptiveclass
|
||||||
# skillclass = coursestandard.skillclass
|
skillclass = coursestandard.skillclass
|
||||||
|
|
||||||
# returnurl = reverse(virtualevent_register_view,
|
returnurl = reverse(virtualevent_register_view,
|
||||||
# kwargs={'id':race.id})
|
kwargs={'id':race.id})
|
||||||
|
|
||||||
# if age < coursestandard.agemin:
|
if age < coursestandard.agemin:
|
||||||
# messages.error(request,'You are younger than the minimum age for this group')
|
messages.error(request,'You are younger than the minimum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if age > coursestandard.agemax:
|
if age > coursestandard.agemax:
|
||||||
# messages.error(request,'You are older than the maximum age for this group')
|
messages.error(request,'You are older than the maximum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'male' and coursestandard.sex != 'male':
|
if sex == 'male' and coursestandard.sex != 'male':
|
||||||
# messages.error(request,'Men are not allowed to enter this category')
|
messages.error(request,'Men are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
||||||
# messages.error(request,'Mixed crews are not allowed to enter this category')
|
messages.error(request,'Mixed crews are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
|
|
||||||
record = VirtualRaceResult(
|
record = VirtualRaceResult(
|
||||||
@@ -1608,8 +1608,8 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
boattype=boattype,
|
boattype=boattype,
|
||||||
boatclass=boatclass,
|
boatclass=boatclass,
|
||||||
coursecompleted=False,
|
coursecompleted=False,
|
||||||
# referencespeed=referencespeed,
|
referencespeed=referencespeed,
|
||||||
# entrycategory=coursestandard,
|
entrycategory=coursestandard,
|
||||||
sex=sex,
|
sex=sex,
|
||||||
age=age,
|
age=age,
|
||||||
)
|
)
|
||||||
@@ -1639,13 +1639,13 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
|
|
||||||
form = VirtualRaceResultForm(initial=initial) #,categories=categories)
|
form = VirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -1706,10 +1706,10 @@ def virtualevent_register_view(request,id=0):
|
|||||||
except VirtualRace.DoesNotExist:
|
except VirtualRace.DoesNotExist:
|
||||||
raise Http404("Virtual Challenge does not exist")
|
raise Http404("Virtual Challenge does not exist")
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
if not race_can_register(r,race):
|
if not race_can_register(r,race):
|
||||||
messages.error(request,"You cannot register for this race")
|
messages.error(request,"You cannot register for this race")
|
||||||
@@ -1724,7 +1724,7 @@ def virtualevent_register_view(request,id=0):
|
|||||||
# we're still here
|
# we're still here
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
# process form
|
# process form
|
||||||
form = VirtualRaceResultForm(request.POST) #,categories=categories)
|
form = VirtualRaceResultForm(request.POST,categories=categories)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
cd = form.cleaned_data
|
cd = form.cleaned_data
|
||||||
teamname = cd['teamname']
|
teamname = cd['teamname']
|
||||||
@@ -1747,36 +1747,36 @@ def virtualevent_register_view(request,id=0):
|
|||||||
sex = 'male'
|
sex = 'male'
|
||||||
|
|
||||||
|
|
||||||
# coursestandard = None
|
coursestandard = None
|
||||||
# referencespeed = 5.0
|
referencespeed = 5.0
|
||||||
|
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# coursestandard = cd['entrycategory']
|
coursestandard = cd['entrycategory']
|
||||||
# referencespeed = coursestandard.referencespeed
|
referencespeed = coursestandard.referencespeed
|
||||||
# boattype = coursestandard.boattype
|
boattype = coursestandard.boattype
|
||||||
# boatclass = coursestandard.boatclass
|
boatclass = coursestandard.boatclass
|
||||||
# weightcategory = coursestandard.weightclass
|
weightcategory = coursestandard.weightclass
|
||||||
# adaptiveclass = coursestandard.adaptiveclass
|
adaptiveclass = coursestandard.adaptiveclass
|
||||||
# skillclass = coursestandard.skillclass
|
skillclass = coursestandard.skillclass
|
||||||
|
|
||||||
# returnurl = reverse(virtualevent_register_view,
|
returnurl = reverse(virtualevent_register_view,
|
||||||
# kwargs={'id':race.id})
|
kwargs={'id':race.id})
|
||||||
|
|
||||||
# if age < coursestandard.agemin:
|
if age < coursestandard.agemin:
|
||||||
# messages.error(request,'You are younger than the minimum age for this group')
|
messages.error(request,'You are younger than the minimum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if age > coursestandard.agemax:
|
if age > coursestandard.agemax:
|
||||||
# messages.error(request,'You are older than the maximum age for this group')
|
messages.error(request,'You are older than the maximum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'male' and coursestandard.sex != 'male':
|
if sex == 'male' and coursestandard.sex != 'male':
|
||||||
# messages.error(request,'Men are not allowed to enter this category')
|
messages.error(request,'Men are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
||||||
# messages.error(request,'Mixed crews are not allowed to enter this category')
|
messages.error(request,'Mixed crews are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1796,8 +1796,8 @@ def virtualevent_register_view(request,id=0):
|
|||||||
coursecompleted=False,
|
coursecompleted=False,
|
||||||
sex=sex,
|
sex=sex,
|
||||||
age=age,
|
age=age,
|
||||||
# entrycategory=coursestandard,
|
entrycategory=coursestandard,
|
||||||
# referencespeed=referencespeed,
|
referencespeed=referencespeed,
|
||||||
)
|
)
|
||||||
|
|
||||||
record.save()
|
record.save()
|
||||||
@@ -1841,12 +1841,12 @@ def virtualevent_register_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
form = VirtualRaceResultForm(initial=initial) #,categories=categories)
|
form = VirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -1948,10 +1948,10 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
except VirtualRace.DoesNotExist:
|
except VirtualRace.DoesNotExist:
|
||||||
raise Http404("Virtual Challenge does not exist")
|
raise Http404("Virtual Challenge does not exist")
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
if not race_can_register(r,race):
|
if not race_can_register(r,race):
|
||||||
messages.error(request,"You cannot register for this race")
|
messages.error(request,"You cannot register for this race")
|
||||||
@@ -1966,7 +1966,7 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
# we're still here
|
# we're still here
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
# process form
|
# process form
|
||||||
form = IndoorVirtualRaceResultForm(request.POST) #,categories=categories)
|
form = IndoorVirtualRaceResultForm(request.POST,categories=categories)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
cd = form.cleaned_data
|
cd = form.cleaned_data
|
||||||
teamname = cd['teamname']
|
teamname = cd['teamname']
|
||||||
@@ -1984,35 +1984,35 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
if sex == 'not specified':
|
if sex == 'not specified':
|
||||||
sex = 'male'
|
sex = 'male'
|
||||||
|
|
||||||
# coursestandard = None
|
coursestandard = None
|
||||||
# referencespeed = 5.0
|
referencespeed = 5.0
|
||||||
|
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# coursestandard = cd['entrycategory']
|
coursestandard = cd['entrycategory']
|
||||||
# referencespeed = coursestandard.referencespeed
|
referencespeed = coursestandard.referencespeed
|
||||||
# boatclass = coursestandard.boatclass
|
boatclass = coursestandard.boatclass
|
||||||
# weightcategory = coursestandard.weightclass
|
weightcategory = coursestandard.weightclass
|
||||||
# adaptiveclass = coursestandard.adaptiveclass
|
adaptiveclass = coursestandard.adaptiveclass
|
||||||
# skillclass = coursestandard.skillclass
|
skillclass = coursestandard.skillclass
|
||||||
|
|
||||||
# returnurl = reverse(virtualevent_register_view,
|
returnurl = reverse(virtualevent_register_view,
|
||||||
# kwargs={'id':race.id})
|
kwargs={'id':race.id})
|
||||||
|
|
||||||
# if age < coursestandard.agemin:
|
if age < coursestandard.agemin:
|
||||||
# messages.error(request,'You are younger than the minimum age for this group')
|
messages.error(request,'You are younger than the minimum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if age > coursestandard.agemax:
|
if age > coursestandard.agemax:
|
||||||
# messages.error(request,'You are older than the maximum age for this group')
|
messages.error(request,'You are older than the maximum age for this group')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'male' and coursestandard.sex != 'male':
|
if sex == 'male' and coursestandard.sex != 'male':
|
||||||
# messages.error(request,'Men are not allowed to enter this category')
|
messages.error(request,'Men are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
# if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
if sex == 'mixed' and coursestandard.sex not in ['mixed','male']:
|
||||||
# messages.error(request,'Mixed crews are not allowed to enter this category')
|
messages.error(request,'Mixed crews are not allowed to enter this category')
|
||||||
# return HttpResponseRedirect(returnurl)
|
return HttpResponseRedirect(returnurl)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2031,8 +2031,8 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
coursecompleted=False,
|
coursecompleted=False,
|
||||||
sex=sex,
|
sex=sex,
|
||||||
age=age,
|
age=age,
|
||||||
# entrycategory=coursestandard,
|
entrycategory=coursestandard,
|
||||||
# referencespeed=referencespeed
|
referencespeed=referencespeed
|
||||||
)
|
)
|
||||||
|
|
||||||
record.save()
|
record.save()
|
||||||
@@ -2076,12 +2076,12 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
# categories = None
|
categories = None
|
||||||
# if race.coursestandards is not None:
|
if race.coursestandards is not None:
|
||||||
# categories = CourseStandard.objects.filter(
|
categories = CourseStandard.objects.filter(
|
||||||
# standardcollection=race.coursestandards).order_by("name")
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
form = IndoorVirtualRaceResultForm(initial=initial) #,categories=categories)
|
form = IndoorVirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -2154,7 +2154,7 @@ def indoorvirtualevent_create_view(request):
|
|||||||
evaluation_closure = cd['evaluation_closure']
|
evaluation_closure = cd['evaluation_closure']
|
||||||
contact_phone = cd['contact_phone']
|
contact_phone = cd['contact_phone']
|
||||||
contact_email = cd['contact_email']
|
contact_email = cd['contact_email']
|
||||||
# coursestandards = cd['coursestandards']
|
coursestandards = cd['coursestandards']
|
||||||
|
|
||||||
# correct times
|
# correct times
|
||||||
|
|
||||||
@@ -2209,7 +2209,7 @@ def indoorvirtualevent_create_view(request):
|
|||||||
sessionvalue = sessionvalue,
|
sessionvalue = sessionvalue,
|
||||||
course=None,
|
course=None,
|
||||||
timezone=timezone_str,
|
timezone=timezone_str,
|
||||||
# coursestandards=coursestandards,
|
coursestandards=coursestandards,
|
||||||
evaluation_closure=evaluation_closure,
|
evaluation_closure=evaluation_closure,
|
||||||
registration_closure=registration_closure,
|
registration_closure=registration_closure,
|
||||||
contact_phone=contact_phone,
|
contact_phone=contact_phone,
|
||||||
@@ -2296,7 +2296,7 @@ def virtualevent_create_view(request):
|
|||||||
evaluation_closure = cd['evaluation_closure']
|
evaluation_closure = cd['evaluation_closure']
|
||||||
contact_phone = cd['contact_phone']
|
contact_phone = cd['contact_phone']
|
||||||
contact_email = cd['contact_email']
|
contact_email = cd['contact_email']
|
||||||
# coursestandards = cd['coursestandards']
|
coursestandards = cd['coursestandards']
|
||||||
|
|
||||||
# correct times
|
# correct times
|
||||||
|
|
||||||
@@ -2348,7 +2348,7 @@ def virtualevent_create_view(request):
|
|||||||
evaluation_closure=evaluation_closure,
|
evaluation_closure=evaluation_closure,
|
||||||
registration_closure=registration_closure,
|
registration_closure=registration_closure,
|
||||||
contact_phone=contact_phone,
|
contact_phone=contact_phone,
|
||||||
# coursestandards=coursestandards,
|
coursestandards=coursestandards,
|
||||||
contact_email=contact_email,
|
contact_email=contact_email,
|
||||||
country = course.country,
|
country = course.country,
|
||||||
manager=request.user,
|
manager=request.user,
|
||||||
|
|||||||
Reference in New Issue
Block a user