Private
Public Access
1
0

removing ftp warning in a more elegant way, still need to implement

regular sending
This commit is contained in:
Sander Roosendaal
2023-05-11 23:11:22 +02:00
parent d6b303ba47
commit e6fbd34780
4 changed files with 6 additions and 6 deletions

View File

@@ -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')