Merge branch 'release/v16.5.4'
This commit is contained in:
@@ -1142,6 +1142,12 @@ def update_indoorvirtualrace(ps,cd):
|
|||||||
|
|
||||||
ps.timezone = timezone_str
|
ps.timezone = timezone_str
|
||||||
|
|
||||||
|
if ps.sessiontype == 'fastest_distance':
|
||||||
|
ps.approximate_distance = ps.sessionvalue
|
||||||
|
|
||||||
|
if ps.course is not None:
|
||||||
|
ps.approximate_distance = ps.course.distance
|
||||||
|
|
||||||
ps.save()
|
ps.save()
|
||||||
|
|
||||||
return 1,'Virtual Race Updated'
|
return 1,'Virtual Race Updated'
|
||||||
@@ -1195,6 +1201,12 @@ def update_virtualrace(ps,cd):
|
|||||||
|
|
||||||
ps.timezone = timezone_str
|
ps.timezone = timezone_str
|
||||||
|
|
||||||
|
if ps.sessiontype == 'fastest_distance':
|
||||||
|
ps.approximate_distance = ps.sessionvalue
|
||||||
|
|
||||||
|
if ps.course is not None:
|
||||||
|
ps.approximate_distance = ps.course.distance
|
||||||
|
|
||||||
ps.save()
|
ps.save()
|
||||||
|
|
||||||
return 1,'Virtual Race Updated'
|
return 1,'Virtual Race Updated'
|
||||||
@@ -1685,6 +1697,7 @@ def add_workout_fastestrace(ws, race, r, recordid=0, doregister=False):
|
|||||||
ids = [w.id for w in ws]
|
ids = [w.id for w in ws]
|
||||||
ids = list(set(ids))
|
ids = list(set(ids))
|
||||||
|
|
||||||
|
|
||||||
if len(ids)>1 and race.sessiontype in ['test','coursetest','race','indoorrace','fastest_time','fastest_distance']: # pragma: no cover
|
if len(ids)>1 and race.sessiontype in ['test','coursetest','race','indoorrace','fastest_time','fastest_distance']: # pragma: no cover
|
||||||
errors.append('For tests, you can only attach one workout')
|
errors.append('For tests, you can only attach one workout')
|
||||||
return result,comments,errors,0
|
return result,comments,errors,0
|
||||||
@@ -1725,10 +1738,12 @@ def add_workout_fastestrace(ws, race, r, recordid=0, doregister=False):
|
|||||||
errors.append("Couldn't find this entry")
|
errors.append("Couldn't find this entry")
|
||||||
return result,comments,errors,0
|
return result,comments,errors,0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
records = IndoorVirtualRaceResult.objects.filter(
|
records = IndoorVirtualRaceResult.objects.filter(
|
||||||
userid=r.id,
|
userid=r.id,
|
||||||
race=race,
|
race=race,
|
||||||
workoutid = ws[0].id
|
#workoutid = ws[0].id
|
||||||
)
|
)
|
||||||
|
|
||||||
if ws[0].workouttype != record.boatclass: # pragma: no cover
|
if ws[0].workouttype != record.boatclass: # pragma: no cover
|
||||||
@@ -1757,8 +1772,14 @@ def add_workout_fastestrace(ws, race, r, recordid=0, doregister=False):
|
|||||||
errors.append('Workout %i did not match the race window' % ws[0].id)
|
errors.append('Workout %i did not match the race window' % ws[0].id)
|
||||||
return result,comments,errors,0
|
return result,comments,errors,0
|
||||||
|
|
||||||
|
|
||||||
if result>0:
|
if result>0:
|
||||||
for otherrecord in records: # pragma: no cover
|
for otherrecord in records: # pragma: no cover
|
||||||
|
oldworkouts = Workout.objects.filter(plannedsession=race)
|
||||||
|
for oldworkout in oldworkouts:
|
||||||
|
oldworkout.plannedsession = None
|
||||||
|
oldworkout.save()
|
||||||
|
|
||||||
otherrecord.workoutid = None
|
otherrecord.workoutid = None
|
||||||
otherrecord.coursecompleted = False
|
otherrecord.coursecompleted = False
|
||||||
otherrecord.save()
|
otherrecord.save()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
BETA: Box Chart Statistics of stroke metrics over a date range
|
Box Chart Statistics of stroke metrics over a date range
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="rounder">
|
<li class="rounder">
|
||||||
|
|||||||
@@ -24,6 +24,10 @@
|
|||||||
<form id="race_submit_form"
|
<form id="race_submit_form"
|
||||||
method="post">
|
method="post">
|
||||||
<p>Select one of the following workouts that you rowed within the challenge window</p>
|
<p>Select one of the following workouts that you rowed within the challenge window</p>
|
||||||
|
<p>
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</p>
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
{% for field in w_form.hidden_fields %}
|
{% for field in w_form.hidden_fields %}
|
||||||
@@ -37,10 +41,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>
|
|
||||||
{% csrf_token %}
|
|
||||||
<input type="submit" value="Submit">
|
|
||||||
</p>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -255,7 +255,15 @@
|
|||||||
<td>{{ result.points|sigdig:4 }}</td>
|
<td>{{ result.points|sigdig:4 }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>
|
<td>
|
||||||
|
{% if race.sessiontype == 'race' %}
|
||||||
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
|
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
|
||||||
|
{% elif race.sessiontype == 'fastest_time' %}
|
||||||
|
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/nocourse/">
|
||||||
|
{% elif race.sessiontype == 'fastest_distance' %}
|
||||||
|
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/nocourse/">
|
||||||
|
{% else %}
|
||||||
|
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
|
||||||
|
{% endif %}
|
||||||
<i class="fas fa-search-plus fa-fw"></i></a>
|
<i class="fas fa-search-plus fa-fw"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -2775,6 +2775,11 @@ def fastestvirtualevent_create_view(request):
|
|||||||
|
|
||||||
vs.save()
|
vs.save()
|
||||||
|
|
||||||
|
if vs.sessiontype == 'fastest_distance':
|
||||||
|
vs.approximate_distance = vs.sessionvalue
|
||||||
|
|
||||||
|
vs.save()
|
||||||
|
|
||||||
# create Site Announcement & Tweet
|
# create Site Announcement & Tweet
|
||||||
if settings.DEBUG or settings.TESTING:
|
if settings.DEBUG or settings.TESTING:
|
||||||
dotweet = False
|
dotweet = False
|
||||||
@@ -3000,7 +3005,6 @@ def virtualevent_edit_view(request,id=0):
|
|||||||
racecreateform = VirtualRaceForm(request.POST,instance=race)
|
racecreateform = VirtualRaceForm(request.POST,instance=race)
|
||||||
if racecreateform.is_valid():
|
if racecreateform.is_valid():
|
||||||
cd = racecreateform.cleaned_data
|
cd = racecreateform.cleaned_data
|
||||||
|
|
||||||
res, message = update_virtualrace(race,cd)
|
res, message = update_virtualrace(race,cd)
|
||||||
|
|
||||||
if res:
|
if res:
|
||||||
@@ -3253,6 +3257,7 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
|
|||||||
#workouttype__in=mytypes.rowtypes,
|
#workouttype__in=mytypes.rowtypes,
|
||||||
startdatetime__gte=startdatetime,
|
startdatetime__gte=startdatetime,
|
||||||
startdatetime__lte=enddatetime,
|
startdatetime__lte=enddatetime,
|
||||||
|
distance__gte=race.approximate_distance,
|
||||||
).order_by("-date","-startdatetime","id")
|
).order_by("-date","-startdatetime","id")
|
||||||
|
|
||||||
if not ws: # pragma: no cover
|
if not ws: # pragma: no cover
|
||||||
|
|||||||
Reference in New Issue
Block a user