fix: commit after each write

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
Raffael Meyer 2023-11-27 20:12:14 +01:00 committed by GitHub
parent a81b8f4ba4
commit 380a67777a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,3 +6,4 @@ def execute():
for name, email in frappe.get_all("Email Group Member", fields=["name", "email"], as_list=True):
if not validate_email_address(email, throw=False):
frappe.db.set_value("Email Group Member", name, "unsubscribed", 1)
frappe.db.commit()