Private
Public Access
1
0

Merge branch 'release/v11.96'

This commit is contained in:
Sander Roosendaal
2020-03-21 09:33:18 +01:00
2 changed files with 27 additions and 23 deletions

View File

@@ -31,7 +31,7 @@
{% block main %}
<h1>{{ race.name }}</h1>
<p>
@@ -77,7 +77,7 @@
</p>
<div class="mapdiv">
{{ coursediv|safe }}
{{ coursescript|safe }}
</div>
</li>
@@ -181,7 +181,7 @@
</td>
<td>
Upload a new workout to the site and submit it as a result. You
need a workout data file.
need a workout data file.
</td>
</tr>
{% if race.sessiontype == 'indoorrace' %}
@@ -266,7 +266,7 @@
<tr>
<td>{{ forloop.counter }}</td>
<td>
<a href="/rowers/workout/{{ result.workoutid }}">
<a href="/rowers/workout/{{ result.workoutid|encode }}">
{{ result.username }}</a></td>
<td>{{ result.teamname }}</td>
<td>{{ result.age }}</td>
@@ -286,7 +286,7 @@
<td>{{ result.duration |durationprint:"%H:%M:%S.%f" }}</td>
<td>{{ result.distance }} m</td>
<td>
<a href="/rowers/workout/{{ result.workoutid }}">
<a href="/rowers/workout/{{ result.workoutid|encode }}">
Details</a></td>
<td>
{% if race.manager == request.user and not race|is_final %}
@@ -413,7 +413,7 @@
{% else %}
<a href="/rowers/raceregistration/togglenotification/{{ race.id }}">
Subscribe to race notifications by email
</a>
</a>
{% endif %}
{% else %}
{% if record.emailnotifications %}
@@ -423,7 +423,7 @@
{% else %}
<a href="/rowers/indoorraceregistration/togglenotification/{{ race.id }}">
Subscribe to race notifications by email
</a>
</a>
{% endif %}
{% endif %}
{% endif %}
@@ -479,7 +479,7 @@
</p>
<p>
The results table has a link to a page where details of your workout
are shown.
are shown.
</p>
<p>
Race results are stored permanently and are not deleted when
@@ -507,7 +507,7 @@
<p>
Until the evaluation closure time, the race organizer can
review and reject entries. If you are disqualified in this
way, you will receive an email with the reason.
way, you will receive an email with the reason.
</p>
</div>
</li>

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