unrestricting planned session api
This commit is contained in:
@@ -458,7 +458,7 @@ def calculate_goldmedalstandard(rower, workout, recurrance=True):
|
|||||||
if settings.TESTING:
|
if settings.TESTING:
|
||||||
background = False
|
background = False
|
||||||
if recurrance:
|
if recurrance:
|
||||||
df, delta, cpvalues = setcp(workout, background=background)
|
df, delta, cpvalues, cpvalues_spm = setcp(workout, background=background)
|
||||||
if df.is_empty():
|
if df.is_empty():
|
||||||
return 0, 0
|
return 0, 0
|
||||||
else:
|
else:
|
||||||
@@ -466,7 +466,7 @@ def calculate_goldmedalstandard(rower, workout, recurrance=True):
|
|||||||
|
|
||||||
|
|
||||||
if df.is_empty() and recurrance: # pragma: no cover
|
if df.is_empty() and recurrance: # pragma: no cover
|
||||||
df, delta, cpvalues = setcp(workout, recurrance=False, background=True)
|
df, delta, cpvalues, cpvalues_spm = setcp(workout, recurrance=False, background=True)
|
||||||
if df.is_empty():
|
if df.is_empty():
|
||||||
return 0, 0
|
return 0, 0
|
||||||
|
|
||||||
@@ -818,7 +818,7 @@ def update_rolling_cp(r, types, mode='water', dosend=False):
|
|||||||
user=r
|
user=r
|
||||||
)
|
)
|
||||||
|
|
||||||
delta, cp, avgpower, workoutnames, urls = fetchcp_new(r, workouts)
|
delta, cp, cr, avgpower, workoutnames, urls = fetchcp_new(r, workouts)
|
||||||
|
|
||||||
powerdf = pl.DataFrame({
|
powerdf = pl.DataFrame({
|
||||||
'Delta': delta,
|
'Delta': delta,
|
||||||
@@ -1071,7 +1071,7 @@ def checkbreakthrough(w, r):
|
|||||||
ishard = False
|
ishard = False
|
||||||
workouttype = w.workouttype
|
workouttype = w.workouttype
|
||||||
if workouttype in rowtypes:
|
if workouttype in rowtypes:
|
||||||
cpdf, delta, cpvalues = setcp(w)
|
cpdf, delta, cpvalues, cpvalues_spm = setcp(w)
|
||||||
if not cpdf.is_empty():
|
if not cpdf.is_empty():
|
||||||
if workouttype in otwtypes:
|
if workouttype in otwtypes:
|
||||||
try:
|
try:
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -59,10 +59,7 @@ class PlannedSessionViewSet(viewsets.ModelViewSet):
|
|||||||
def get_queryset(self): # pragma: no cover
|
def get_queryset(self): # pragma: no cover
|
||||||
try:
|
try:
|
||||||
r = Rower.objects.get(user=self.request.user)
|
r = Rower.objects.get(user=self.request.user)
|
||||||
if r.rowerplan not in ['basic', 'pro']:
|
return PlannedSession.objects.filter(rower=r).order_by("-preferreddate")
|
||||||
return PlannedSession.objects.filter(rower=r).order_by("-preferreddate")
|
|
||||||
else:
|
|
||||||
return []
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user