Private
Public Access
1
0

initial implementation.

To Do: Add unsubscribe/subscribe functionality for participants
This commit is contained in:
Sander Roosendaal
2018-11-30 17:15:50 +01:00
parent 3fa95b8088
commit 73b8941825
7 changed files with 162 additions and 3 deletions

View File

@@ -168,6 +168,8 @@ from rowers.tasks import (
handle_update_empower,
handle_sendemailics,
handle_sendemail_userdeleted,
handle_sendemail_raceregistration,
handle_sendemail_racesubmission,
)
from scipy.signal import savgol_filter
@@ -16526,6 +16528,22 @@ def virtualevent_register_view(request,id=0):
add_rower_race(r,race)
otherrecords = IndoorVirtualRaceResult.objects.filter(
race = race).exclude(userid = r.id)
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_raceregistration,
otheruser.user.email, othername,
registeredname,
race.name,
race.id
)
messages.info(
@@ -16633,6 +16651,22 @@ def indoorvirtualevent_register_view(request,id=0):
add_rower_race(r,race)
otherrecords = IndoorVirtualRaceResult.objects.filter(
race = race).exclude(userid = r.id)
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_raceregistration,
otheruser.user.email, othername,
registeredname,
race.name,
race.id
)
messages.info(
@@ -17142,6 +17176,7 @@ def virtualevent_submit_result_view(request,id=0):
race=race
)
entrychoices = []
for record in records:
@@ -17234,6 +17269,25 @@ def virtualevent_submit_result_view(request,id=0):
request.session['async_tasks'] = [(jobid,'submit_race')]
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)
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
)
# redirect to race page
url = reverse(virtualevent_view,