removing ftp warning in a more elegant way, still need to implement
regular sending
This commit is contained in:
@@ -712,7 +712,7 @@ def fetchcp(rower, theworkouts, table='cpdata'): # pragma: no cover
|
||||
return pd.Series([], dtype='float'), pd.Series([], dtype='float'), avgpower2
|
||||
|
||||
|
||||
def update_rolling_cp(r, types, mode='water'):
|
||||
def update_rolling_cp(r, types, mode='water', dosend=False):
|
||||
firstdate = timezone.now()-datetime.timedelta(days=r.cprange)
|
||||
workouts = Workout.objects.filter(
|
||||
date__gte=firstdate,
|
||||
@@ -747,7 +747,7 @@ def update_rolling_cp(r, types, mode='water'):
|
||||
r.p3 = p1[3]
|
||||
r.cpratio = res2[3]
|
||||
r.save()
|
||||
if pwr-5 > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
|
||||
if dosend and pwr-5 > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
|
||||
_ = myqueue(queuehigh, handle_sendemail_newftp,r,pwr,'water')
|
||||
|
||||
else:
|
||||
@@ -757,7 +757,7 @@ def update_rolling_cp(r, types, mode='water'):
|
||||
r.ep3 = p1[3]
|
||||
r.ecpratio = res2[3]
|
||||
r.save()
|
||||
if pwr-5 > r.ftp and r.getemailnotifications and not r.emailbounced:
|
||||
if dosend and pwr-5 > r.ftp and r.getemailnotifications and not r.emailbounced:
|
||||
_ = myqueue(queuehigh, handle_sendemail_newftp,r,pwr,'water')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user