Private
Public Access
1
0

added notification to rowing physics

This commit is contained in:
Sander Roosendaal
2017-06-16 15:41:07 +02:00
parent 81b6d2d919
commit a70a1e98ac
8 changed files with 177 additions and 114 deletions

View File

@@ -69,6 +69,8 @@ def handle_sendemail_breakthrough(workoutid,useremail,userfirstname,userlastname
message += str(workoutid)
message += "/updatecp\n\n"
message += "To opt out of these email notifications, deselect the checkbox on your Profile page under Account Information.\n\n"
message += "Best Regards, the Rowsandall Team"
email = EmailMessage(subject, message,
@@ -79,7 +81,6 @@ def handle_sendemail_breakthrough(workoutid,useremail,userfirstname,userlastname
res = email.send()
# remove tcx file
os.remove(unrecognizedfile)
return 1
@@ -177,7 +178,7 @@ def handle_sendemailcsv(first_name,last_name,email,csvfile):
# Calculate wind and stream corrections for OTW rowing
@app.task
def handle_otwsetpower(f1,boattype,weightvalue,
first_name,last_name,email,workoutid,
first_name,last_name,email,workoutid,ps=[1,1,1,1],
debug=False):
try:
rowdata = rdata(f1)
@@ -219,6 +220,12 @@ def handle_otwsetpower(f1,boattype,weightvalue,
rowdata.write_csv(f1,gzip=True)
update_strokedata(workoutid,rowdata.df,debug=debug)
delta,cpvalues,avgpower = datautils.getsinglecp(rowdata.df)
if utils.isbreakthrough(delta,cpvalues,ps[0],ps[1],ps[2],ps[3]):
handle_sendemail_breakthrough(workoutid,email,
first_name,
last_name)
# send email
fullemail = first_name + " " + last_name + " " + "<" + email + ">"
subject = "Your Rowsandall OTW calculations are ready"