fix: Revert auto_commit after frappe.sendmail
This commit is contained in:
parent
4cbf2c40e6
commit
6b789ec53a
1 changed files with 2 additions and 1 deletions
|
|
@ -165,6 +165,7 @@ class Newsletter(WebsiteGenerator):
|
|||
sender = self.send_from or frappe.utils.get_formatted_email(self.owner)
|
||||
args = {"message": message, "name": self.name}
|
||||
|
||||
is_auto_commit_set = bool(frappe.db.auto_commit_on_many_writes)
|
||||
frappe.db.auto_commit_on_many_writes = not frappe.flags.in_test
|
||||
|
||||
frappe.sendmail(
|
||||
|
|
@ -184,7 +185,7 @@ class Newsletter(WebsiteGenerator):
|
|||
args=args,
|
||||
)
|
||||
|
||||
frappe.db.auto_commit_on_many_writes = not frappe.flags.in_test
|
||||
frappe.db.auto_commit_on_many_writes = is_auto_commit_set
|
||||
|
||||
def get_message(self) -> str:
|
||||
if self.content_type == "HTML":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue