tasks.py
This commit is contained in:
@@ -1552,7 +1552,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
|||||||
|
|
||||||
job = myqueue(queue,handle_check_race_course,ws[0].csvfilename,
|
job = myqueue(queue,handle_check_race_course,ws[0].csvfilename,
|
||||||
ws[0].id,race.course.id,record.id,splitsecond=splitsecond,
|
ws[0].id,race.course.id,record.id,splitsecond=splitsecond,
|
||||||
# referencespeed=record.referencespeed,coursedistance=race.course.distance
|
referencespeed=record.referencespeed,coursedistance=race.course.distance
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -353,15 +353,15 @@ def handle_check_race_course(self,
|
|||||||
else:
|
else:
|
||||||
splitsecond = 0
|
splitsecond = 0
|
||||||
|
|
||||||
# if 'referencespeed' in kwargs:
|
if 'referencespeed' in kwargs:
|
||||||
# referencespeed = kwargs['referencespeed']
|
referencespeed = kwargs['referencespeed']
|
||||||
# else:
|
else:
|
||||||
# referencespeed = 5.0
|
referencespeed = 5.0
|
||||||
|
|
||||||
# if 'coursedistance' in kwargs:
|
if 'coursedistance' in kwargs:
|
||||||
# coursedistance = kwargs['coursedistance']
|
coursedistance = kwargs['coursedistance']
|
||||||
# else:
|
else:
|
||||||
# coursedistance = 0
|
coursedistance = 0
|
||||||
|
|
||||||
mode = 'race'
|
mode = 'race'
|
||||||
if 'mode' in kwargs:
|
if 'mode' in kwargs:
|
||||||
@@ -489,30 +489,28 @@ def handle_check_race_course(self,
|
|||||||
else:
|
else:
|
||||||
coursecompleted = False
|
coursecompleted = False
|
||||||
|
|
||||||
# points = 0
|
points = 0
|
||||||
if coursecompleted:
|
if coursecompleted:
|
||||||
# if coursedistance == 0:
|
if coursedistance == 0:
|
||||||
# coursedistance = coursemeters
|
coursedistance = coursemeters
|
||||||
# velo = coursedistance/coursetimeseconds
|
velo = coursedistance/coursetimeseconds
|
||||||
# points = int(100*(2.-referencespeed/velo))
|
points = int(100*(2.-referencespeed/velo))
|
||||||
# query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||||
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
|
||||||
recordid=recordid,
|
recordid=recordid,
|
||||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||||
distance=int(coursemeters),
|
distance=int(coursemeters),
|
||||||
# points=points,
|
points=points,
|
||||||
workoutid=workoutid,
|
workoutid=workoutid,
|
||||||
startsecond=startsecond,
|
startsecond=startsecond,
|
||||||
endsecond=endsecond,
|
endsecond=endsecond,
|
||||||
)
|
)
|
||||||
|
|
||||||
if mode == 'coursetest':
|
if mode == 'coursetest':
|
||||||
# query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||||
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
|
||||||
recordid=recordid,
|
recordid=recordid,
|
||||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||||
distance=int(coursemeters),
|
distance=int(coursemeters),
|
||||||
# points=points,
|
points=points,
|
||||||
workoutid=workoutid,
|
workoutid=workoutid,
|
||||||
startsecond=startsecond,
|
startsecond=startsecond,
|
||||||
endsecond=endsecond,
|
endsecond=endsecond,
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
as a Male crew. Check the "Mixed gender" check box to register as a
|
as a Male crew. Check the "Mixed gender" check box to register as a
|
||||||
mixed gender crew (except for 1x where this check box does nothing).
|
mixed gender crew (except for 1x where this check box does nothing).
|
||||||
</p>
|
</p>
|
||||||
{% comment %}
|
|
||||||
{% if race.coursestandards %}
|
{% if race.coursestandards %}
|
||||||
<p>This race uses standard times and limits the race groups to those where
|
<p>This race uses standard times and limits the race groups to those where
|
||||||
standard times exist. The "Group" form choice will overrule other selections you
|
standard times exist. The "Group" form choice will overrule other selections you
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
You can check the valid race groups and standard times <a target="_" href="/rowers/standards/{{ race.coursestandards.id }}/">here</a>.
|
You can check the valid race groups and standard times <a target="_" href="/rowers/standards/{{ race.coursestandards.id }}/">here</a>.
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcomment %}
|
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
|
|||||||
Reference in New Issue
Block a user