Private
Public Access
1
0

fixing plannedsessions_view

This commit is contained in:
2023-08-22 22:37:48 +02:00
parent 3b6159d954
commit 6dda955115
2 changed files with 11 additions and 10 deletions

View File

@@ -1518,12 +1518,15 @@ def plannedsessions_view(request,
for w in ws:
thetrimp, hrtss = dataprep.workout_trimp(w)
totals['trimp'] += thetrimp
tss = dataprep.workout_rscore(w)[0]
if not np.isnan(tss) and tss != 0:
totals['rscore'] += tss
elif tss == 0:
totals['rscore'] += hrtss
tss = hrtss
row = {
'rscore': w.rscore,
'hrtss': w.hrtss,
'rpe': w.rpe,
'duration': w.duration,
'id': w.id
}
tss = dataprep.rscore_approx(row)
totals['rscore'] += tss
totals['distance'] += w.distance
totals['time'] += timefield_to_seconds_duration(w.duration)
if w.plannedsession: # pragma: no cover