Private
Public Access
1
0

fix #640 double email when registered participant is also a follower

This commit is contained in:
Sander Roosendaal
2022-09-15 11:10:31 +02:00
parent 81b313dc56
commit a68e571010
2 changed files with 23 additions and 7 deletions

View File

@@ -1873,6 +1873,8 @@ def virtualevent_addboat_view(request, id=0):
otherrecords = resultobj.objects.filter(
race=race).exclude(userid=r.id)
registereduserids = [otherrecord.userid for otherrecord in otherrecords]
for otherrecord in otherrecords:
try:
otheruser = Rower.objects.get(id=otherrecord.userid)
@@ -1892,19 +1894,20 @@ def virtualevent_addboat_view(request, id=0):
followers = VirtualRaceFollower.objects.filter(race=race)
for follower in followers: # pragma: no cover
for follower in followers:
othername = ''
if follower.user:
othername = follower.user.first_name+' '+follower.user.last_name
registeredname = r.user.first_name+' '+r.user.last_name
email = follower.emailaddress
_ = myqueue(
queue,
handle_sendemail_raceregistration,
email, othername,
registeredname, race.name, race.id,
)
if follower.user.id not in registereduserids:
_ = myqueue(
queue,
handle_sendemail_raceregistration,
email, othername,
registeredname, race.name, race.id,
)
url = reverse('virtualevent_view',
kwargs={