fixed breakthrough email issues
This commit is contained in:
@@ -1081,7 +1081,7 @@ def checkbreakthrough(w, r):
|
||||
r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.write_json())
|
||||
btvalues=btvalues.write_json(row_oriented=True))
|
||||
for coach in r.get_coaches():
|
||||
if coach.getemailnotifications and not coach.emailbounced:
|
||||
_ = myqueue(queuehigh, handle_sendemail_breakthrough,
|
||||
@@ -1089,7 +1089,7 @@ def checkbreakthrough(w, r):
|
||||
coach.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.write_json(),
|
||||
btvalues=btvalues.write_json(row_oriented=True),
|
||||
surname=True)
|
||||
|
||||
# submit email task to send email about breakthrough workout
|
||||
|
||||
@@ -13,7 +13,7 @@ from scipy import optimize
|
||||
import rowingdata
|
||||
|
||||
from rowingdata import rowingdata as rdata
|
||||
|
||||
from rowers.utils import dologging
|
||||
from celery import app
|
||||
import datetime
|
||||
import pytz
|
||||
@@ -132,7 +132,8 @@ def send_template_email(from_email, to_email, subject,
|
||||
except User.DoesNotExist:
|
||||
pass
|
||||
except Exception as e:
|
||||
pass
|
||||
dologging('tasks.log',e)
|
||||
|
||||
|
||||
if not emailbounced:
|
||||
res = msg.send()
|
||||
|
||||
@@ -2160,10 +2160,13 @@ def handle_sendemail_breakthrough(workoutid, useremail,
|
||||
surname=False,
|
||||
**kwargs):
|
||||
|
||||
dologging('tasks.log',btvalues)
|
||||
btvalues = pd.read_json(btvalues)
|
||||
|
||||
try:
|
||||
btvalues.sort_values('delta', axis=0, inplace=True)
|
||||
except KeyError:
|
||||
dologging('tasks.log','KeyError')
|
||||
return 0
|
||||
|
||||
lastname = ''
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user