Private
Public Access
1
0

fine tuning the sending of email notifications

This commit is contained in:
Sander Roosendaal
2022-12-17 17:08:25 +01:00
parent a7a33d0d17
commit 238856a224
2 changed files with 10 additions and 7 deletions

View File

@@ -82,6 +82,7 @@ from rowingdata import (
from rowers.dataroutines import *
from rowers.tasks import (
handle_sendemail_newftp,
handle_sendemail_unrecognized, handle_setcp,
handle_getagegrouprecords, handle_update_wps,
handle_request_post, handle_calctrimp,
@@ -735,8 +736,8 @@ def update_rolling_cp(r, types, mode='water'):
r.p3 = p1[3]
r.cpratio = res2[3]
r.save()
if pwr > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
if pwr-5 > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp,r,pwr,'water')
else:
r.ep0 = p1[0]
@@ -745,8 +746,8 @@ def update_rolling_cp(r, types, mode='water'):
r.ep3 = p1[3]
r.ecpratio = res2[3]
r.save()
if pwr > r.ftp and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
if pwr-5 > r.ftp and r.getemailnotifications and not r.emailbounced:
_ = myqueue(queuehigh, handle_sendemail_newftp,r,pwr,'water')
return True