added emailbounced keyword to tasks
This commit is contained in:
@@ -1048,7 +1048,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
||||
powermean = df['power'].mean()
|
||||
except KeyError:
|
||||
powermean = 0
|
||||
|
||||
|
||||
if powermean != 0:
|
||||
thesecs = totaltime
|
||||
maxt = 1.05 * thesecs
|
||||
@@ -1071,45 +1071,27 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
||||
# submit email task to send email about breakthrough workout
|
||||
if isbreakthrough:
|
||||
a_messages.info(
|
||||
r.user, 'It looks like you have a new breakthrough workout')
|
||||
if settings.DEBUG and r.getemailnotifications:
|
||||
res = handle_sendemail_breakthrough.delay(w.id, r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json())
|
||||
elif r.getemailnotifications:
|
||||
try:
|
||||
res = queuehigh.enqueue(
|
||||
handle_sendemail_breakthrough(w.id,
|
||||
r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json()))
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
r.user, 'It looks like you have a new breakthrough workout'
|
||||
)
|
||||
if r.getemailnotifications and not r.emailbounced:
|
||||
job = myqueue(queuehigh,handle_sendemail_breakthrough,
|
||||
w.id,
|
||||
r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json())
|
||||
|
||||
# submit email task to send email about breakthrough workout
|
||||
if ishard:
|
||||
a_messages.info(r.user, 'That was a pretty hard workout')
|
||||
if settings.DEBUG and r.getemailnotifications:
|
||||
res = handle_sendemail_hard.delay(w.id, r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json())
|
||||
elif r.getemailnotifications:
|
||||
try:
|
||||
res = queuehigh.enqueue(
|
||||
handle_sendemail_hard(w.id,
|
||||
r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json()))
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
|
||||
if r.getemailnotifications and not r.emailbounced:
|
||||
job = myqueue(queuehigh,handle_sendemail_hard,
|
||||
w.id,
|
||||
r.user.email,
|
||||
r.user.first_name,
|
||||
r.user.last_name,
|
||||
btvalues=btvalues.to_json())
|
||||
|
||||
|
||||
return (w.id, message)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user