fixing zero division
This commit is contained in:
@@ -1636,7 +1636,11 @@ def workout_trimp(w, reset=False):
|
||||
return w.trimp, 0
|
||||
elif w.trimp <= 0 and w.averagehr > 0:
|
||||
if get_existing_job(w):
|
||||
return 0, 100.*(w.averagehr/r.hrftp)*(w.duration.hour*60 + w.duration.minute)/60.
|
||||
try:
|
||||
return 0, 100.*(w.averagehr/r.hrftp)*(w.duration.hour*60 + w.duration.minute)/60.
|
||||
except ZeroDivisionError:
|
||||
return 0, 0
|
||||
|
||||
ftp = float(r.ftp)
|
||||
_ = myqueue(
|
||||
queuehigh,
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user