Private
Public Access
1
0

fixes races view

This commit is contained in:
Sander Roosendaal
2020-03-21 09:24:41 +01:00
parent 35eda69122
commit f8bb6d79b6
2 changed files with 27 additions and 23 deletions

View File

@@ -2155,24 +2155,28 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
messages.info(request,"We are evaluating your result. The page will reload when we're done. Your result will show up if you adhered to the course")
if result:
otherrecords = resultobj.objects.filter(
race = race).exclude(userid = r.id)
otherrecords = resultobj.objects.filter(race = race).exclude(userid = r.id)
if not jobid:
messages.info(request,"Result submitted successfully.")
for otherrecord in otherrecords:
otheruser = Rower.objects.get(id=otherrecord.userid)
othername = otheruser.user.first_name+' '+otheruser.user.last_name
registeredname = r.user.first_name+' '+r.user.last_name
if otherrecord.emailnotifications:
job = myqueue(
queue,
handle_sendemail_racesubmission,
otheruser.user.email, othername,
registeredname,
race.name,
race.id
)
try:
otheruser = Rower.objects.get(id=otherrecord.userid)
othername = otheruser.user.first_name+' '+otheruser.user.last_name
registeredname = r.user.first_name+' '+r.user.last_name
if otherrecord.emailnotifications:
job = myqueue(
queue,
handle_sendemail_racesubmission,
otheruser.user.email, othername,
registeredname,
race.name,
race.id
)
except Rower.DoesNotExist:
pass
# redirect to race page