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,
|
||||
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:
|
||||
splitsecond = 0
|
||||
|
||||
# if 'referencespeed' in kwargs:
|
||||
# referencespeed = kwargs['referencespeed']
|
||||
# else:
|
||||
# referencespeed = 5.0
|
||||
if 'referencespeed' in kwargs:
|
||||
referencespeed = kwargs['referencespeed']
|
||||
else:
|
||||
referencespeed = 5.0
|
||||
|
||||
# if 'coursedistance' in kwargs:
|
||||
# coursedistance = kwargs['coursedistance']
|
||||
# else:
|
||||
# coursedistance = 0
|
||||
if 'coursedistance' in kwargs:
|
||||
coursedistance = kwargs['coursedistance']
|
||||
else:
|
||||
coursedistance = 0
|
||||
|
||||
mode = 'race'
|
||||
if 'mode' in kwargs:
|
||||
@@ -489,30 +489,28 @@ def handle_check_race_course(self,
|
||||
else:
|
||||
coursecompleted = False
|
||||
|
||||
# points = 0
|
||||
points = 0
|
||||
if coursecompleted:
|
||||
# if coursedistance == 0:
|
||||
# coursedistance = coursemeters
|
||||
# velo = coursedistance/coursetimeseconds
|
||||
# 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} WHERE id={recordid}'.format(
|
||||
if coursedistance == 0:
|
||||
coursedistance = coursemeters
|
||||
velo = coursedistance/coursetimeseconds
|
||||
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(
|
||||
recordid=recordid,
|
||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||
distance=int(coursemeters),
|
||||
# points=points,
|
||||
points=points,
|
||||
workoutid=workoutid,
|
||||
startsecond=startsecond,
|
||||
endsecond=endsecond,
|
||||
)
|
||||
|
||||
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} 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(
|
||||
recordid=recordid,
|
||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||
distance=int(coursemeters),
|
||||
# points=points,
|
||||
points=points,
|
||||
workoutid=workoutid,
|
||||
startsecond=startsecond,
|
||||
endsecond=endsecond,
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
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).
|
||||
</p>
|
||||
{% comment %}
|
||||
{% if race.coursestandards %}
|
||||
<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
|
||||
@@ -46,7 +45,6 @@
|
||||
You can check the valid race groups and standard times <a target="_" href="/rowers/standards/{{ race.coursestandards.id }}/">here</a>.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endcomment %}
|
||||
<div class="grid_6 alpha">
|
||||
<table width="100%">
|
||||
{{ form.as_table }}
|
||||
|
||||
Reference in New Issue
Block a user