Merge branch 'develop' into feature/fastestchallenges
This commit is contained in:
@@ -397,17 +397,22 @@ def add_workouts_plannedsession(ws,ps,r):
|
||||
if ps.sessiontype == 'fastest_distance':
|
||||
records = CourseTestResult.objects.filter(userid=w.user.id,plannedsession=ps)
|
||||
for record in records:
|
||||
w1 = Workout.objects.get(id=record.workoutid)
|
||||
w1.plannedsession = None
|
||||
w1.save()
|
||||
record.delete()
|
||||
|
||||
df = dataprep.getsmallrowdata_db(['time','cumdist'],ids=[w.id])
|
||||
fastest_milliseconds = datautils.getfastest(df,ps.sessionvalue,mode='distance')
|
||||
|
||||
if fastest_milliseconds > 0:
|
||||
w.plannedsession = ps
|
||||
w.save()
|
||||
|
||||
duration = to_time(1000.*fastest_milliseconds)
|
||||
|
||||
record = CourseTestResult(
|
||||
userid=w.useruser..id,
|
||||
userid=w.user.user.id,
|
||||
plannedsession = ps,
|
||||
duration = duration,
|
||||
coursecompleted = True,
|
||||
@@ -429,12 +434,17 @@ def add_workouts_plannedsession(ws,ps,r):
|
||||
if ps.sessiontype == 'fastest_time':
|
||||
records = CourseTestResult.objects.filter(userid=w.user.id,plannedsession=ps)
|
||||
for record in records:
|
||||
w1 = Workout.objects.get(id=record.workoutid)
|
||||
w1.plannedsession = None
|
||||
w1.save()
|
||||
record.delete()
|
||||
|
||||
df = dataprep.getsmallrowdata_db(['time','cumdist'],ids=[w.id])
|
||||
fastest_meters = datautils.getfastest(df,ps.sessionvalue,mode='time')
|
||||
|
||||
if fastest_meters > 0:
|
||||
w.plannedsession = ps
|
||||
w.save()
|
||||
duration = dt.time(0,ps.sessionvalue)
|
||||
|
||||
record = CourseTestResult(
|
||||
@@ -710,7 +720,7 @@ def is_session_complete_ws(ws,ps):
|
||||
return ratio,'partial',completiondate
|
||||
return (0,'partial',None)
|
||||
elif ps.sessiontype in ['fastest_time','fastest_distance']:
|
||||
vs = CourseTestResult.objects.filter(plannedsession=ps,userid=ws[0].user.id)
|
||||
vs = CourseTestResult.objects.filter(plannedsession=ps,userid=ws[0].user.user.id)
|
||||
completiondate = ws.reverse()[0].date
|
||||
wids = [w.id for w in ws]
|
||||
for record in vs:
|
||||
|
||||
@@ -55,7 +55,11 @@
|
||||
The participants can row this challenge on any course, and their fastest time
|
||||
over the challenge distance (respectively the largest distance achieved over the
|
||||
challenge duration) is automatically extracted from the workout. No
|
||||
<<<<<<< HEAD
|
||||
need to program a set piece.
|
||||
=======
|
||||
need to program a set piece.
|
||||
>>>>>>> develop
|
||||
</p>
|
||||
<p>
|
||||
Standard Times are a way to compare results in a race category with
|
||||
|
||||
Reference in New Issue
Block a user