fix: move email status check to fix travis
mail status wasn't being set when the check was run, so the output for any() would always be false, and none of the mails would have status set to sent in the backend. moving the check to a point after setting status for each email should fix this issue Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
parent
e2935b5ba6
commit
4c138390b6
1 changed files with 2 additions and 2 deletions
|
|
@ -382,8 +382,6 @@ def send_one(email, smtpserver=None, auto_commit=True, now=False, from_test=Fals
|
|||
recipients_list = frappe.db.sql('''select name, recipient, status from
|
||||
`tabEmail Queue Recipient` where parent=%s''', email.name, as_dict=1)
|
||||
|
||||
email_sent_to_any_recipient = any("Sent" == s.status for s in recipients_list)
|
||||
|
||||
if frappe.are_emails_muted():
|
||||
frappe.msgprint(_("Emails are muted"))
|
||||
return
|
||||
|
|
@ -427,6 +425,8 @@ def send_one(email, smtpserver=None, auto_commit=True, now=False, from_test=Fals
|
|||
frappe.db.sql("""update `tabEmail Queue Recipient` set status='Sent', modified=%s where name=%s""",
|
||||
(now_datetime(), recipient.name), auto_commit=auto_commit)
|
||||
|
||||
email_sent_to_any_recipient = any("Sent" == s.status for s in recipients_list)
|
||||
|
||||
#if all are sent set status
|
||||
if email_sent_to_any_recipient:
|
||||
frappe.db.sql("""update `tabEmail Queue` set status='Sent', modified=%s where name=%s""",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue