Private
Public Access
1
0

Merge branch 'release/v19.0.0'

This commit is contained in:
Sander Roosendaal
2023-06-02 15:38:06 +02:00
4 changed files with 30 additions and 4 deletions
+28 -2
View File
@@ -1621,7 +1621,26 @@ def get_existing_job(w):
def workout_trimp(w, reset=False):
r = w.user
if w.trimp > -1 and not reset:
if w.trimp is None:
if get_existing_job(w):
return 0, 0
elif w.averagehr is None:
if get_existing_job(w):
return w.trimp, 0
elif w.trimp <= 0 and w.averagehr > 0:
ftp = float(r.ftp)
_ = myqueue(
queuehigh,
handle_calctrimp,
w.id,
w.csvfilename,
ftp,
r.sex,
r.hrftp,
r.max,
r.rest)
return w.trimp, w.hrtss
elif w.trimp > -1 and not reset:
return w.trimp, w.hrtss
if get_existing_job(w):
@@ -1662,7 +1681,14 @@ def workout_trimp(w, reset=False):
r.max,
r.rest)
return 0, 0
trimp = 0
averagehr = 0
if w.trimp is not None and w.trimp > 0:
trimp = w.trimp
if w.averagehr is not None and w.averagehr > 0:
averagehr = w.averagehr
return trimp, averagehr
def workout_rscore(w, reset=False):
Binary file not shown.
+1 -1
View File
@@ -372,7 +372,7 @@ def workout_import_view(request, source='c2'):
_ = integration.open()
except NoTokenError: # pragma: no cover
try:
url = importauthorizeviews[source]
url = reverse(importauthorizeviews[source],kwargs={'source':source})
return HttpResponseRedirect(url)
except KeyError:
messages.error(request,'Sorry, an error occurred. Please reauthorize')