fixes
This commit is contained in:
@@ -1385,7 +1385,7 @@ def default_class(r,w,race):
|
|||||||
adaptiveclass=adaptiveclass,
|
adaptiveclass=adaptiveclass,
|
||||||
boattype=boattype,
|
boattype=boattype,
|
||||||
).order_by(
|
).order_by(
|
||||||
"agemax","-agemin","boattype","sex","weightcategory",
|
"agemax","-agemin","boattype","sex","weightclass",
|
||||||
"referencespeed"
|
"referencespeed"
|
||||||
)
|
)
|
||||||
if standards.count()==0:
|
if standards.count()==0:
|
||||||
@@ -1394,7 +1394,7 @@ def default_class(r,w,race):
|
|||||||
boattype=boattype
|
boattype=boattype
|
||||||
).order_by(
|
).order_by(
|
||||||
"agemax","-agemin","boattype","sex",
|
"agemax","-agemin","boattype","sex",
|
||||||
"weightcategory","referencespeed")
|
"weightclass","referencespeed")
|
||||||
if standards.count()==0:
|
if standards.count()==0:
|
||||||
standards = CourseStandard.objects.filter(
|
standards = CourseStandard.objects.filter(
|
||||||
agemin__lt=age,agemax__gt=age
|
agemin__lt=age,agemax__gt=age
|
||||||
|
|||||||
@@ -587,13 +587,25 @@ def handle_check_race_course(self,
|
|||||||
endsecond=endsecond,
|
endsecond=endsecond,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
with engine.connect() as conn, conn.begin():
|
with engine.connect() as conn, conn.begin():
|
||||||
result = conn.execute(query)
|
result = conn.execute(query)
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
engine.dispose()
|
engine.dispose()
|
||||||
|
|
||||||
|
# add times for all gates to log file
|
||||||
|
with open(logfile,'a') as f:
|
||||||
|
t = time.localtime()
|
||||||
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('--- LOG of all gate times---')
|
||||||
|
|
||||||
|
for path,polygon in (paths,polygons):
|
||||||
|
( secs,meters,completed) = coursetime_paths(rowdata2,
|
||||||
|
[path],[polygon],logfile=logfile)
|
||||||
|
|
||||||
|
|
||||||
# send email
|
# send email
|
||||||
handle_sendemail_coursefail(
|
handle_sendemail_coursefail(
|
||||||
useremail,userfirstname,logfile
|
useremail,userfirstname,logfile
|
||||||
|
|||||||
@@ -3277,6 +3277,7 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
|
|||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
cd = form.cleaned_data
|
cd = form.cleaned_data
|
||||||
|
|
||||||
|
|
||||||
teamname = cd['teamname']
|
teamname = cd['teamname']
|
||||||
try:
|
try:
|
||||||
boattype = cd['boattype']
|
boattype = cd['boattype']
|
||||||
@@ -3293,12 +3294,12 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
|
|||||||
acceptsocialmedia = cd['acceptsocialmedia']
|
acceptsocialmedia = cd['acceptsocialmedia']
|
||||||
|
|
||||||
sex = r.sex
|
sex = r.sex
|
||||||
|
|
||||||
if mix:
|
if mix:
|
||||||
sex = 'mixed'
|
sex = 'mixed'
|
||||||
|
|
||||||
if boattype == '1x' and r.birthdate:
|
if boattype == '1x' and r.birthdate:
|
||||||
age = calculate_age(r.birthdate)
|
age = calculate_age(r.birthdate)
|
||||||
sex = r.sex
|
|
||||||
|
|
||||||
if sex == 'not specified':
|
if sex == 'not specified':
|
||||||
sex = 'male'
|
sex = 'male'
|
||||||
@@ -3328,6 +3329,7 @@ def virtualevent_entry_edit_view(request,id=0,entryid=0):
|
|||||||
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)
|
||||||
|
|
||||||
|
print(sex,coursestandard.sex)
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user