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'
|
sex = 'male'
|
||||||
|
|
||||||
if boattype in boattypes and boatclass in boatclasses:
|
if boattype in boattypes and boatclass in boatclasses:
|
||||||
messages.error(request,"You have already registered in that boat class/type")
|
# check if different sexes
|
||||||
url = reverse(virtualevent_view,
|
therecords = records.filter(
|
||||||
kwargs = {
|
boattype=boattype,
|
||||||
'id': race.id
|
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(
|
record = VirtualRaceResult(
|
||||||
userid=r.id,
|
userid=r.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user