can now register in one boat class/type with M/F and mixed
This commit is contained in:
@@ -13888,14 +13888,25 @@ def virtualevent_addboat_view(request,id=0):
|
||||
sex = 'male'
|
||||
|
||||
if boattype in boattypes and boatclass in boatclasses:
|
||||
messages.error(request,"You have already registered in that boat class/type")
|
||||
url = reverse(virtualevent_view,
|
||||
kwargs = {
|
||||
'id': race.id
|
||||
# check if different sexes
|
||||
therecords = records.filter(
|
||||
boattype=boattype,
|
||||
boatclass=boatclass)
|
||||
|
||||
thesexes = [record.sex for record in therecords]
|
||||
if sex in thesexes:
|
||||
|
||||
messages.error(
|
||||
request,
|
||||
"You have already registered in that boat class/type"
|
||||
)
|
||||
url = reverse(virtualevent_view,
|
||||
kwargs = {
|
||||
'id': race.id
|
||||
}
|
||||
)
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
record = VirtualRaceResult(
|
||||
userid=r.id,
|
||||
|
||||
Reference in New Issue
Block a user