fix(patch): only run disable_email_accounts_with_oauth if connected user is not set (#20799)

This commit is contained in:
Ritwik Puri 2023-04-20 22:03:11 +05:30 committed by GitHub
parent 6eac7e603e
commit cd67ad420f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,9 @@ from frappe.desk.doctype.notification_log.notification_log import make_notificat
def execute():
if not frappe.get_value("Email Account", {"auth_method": "OAuth"}):
if frappe.get_all(
"Email Account", {"auth_method": "OAuth", "connected_user": ["is", "set"]}, limit=1
):
return
# Setting awaiting password to 1 for email accounts where Oauth is enabled.