From cd67ad420fd6f64401efb97548bd3178bb089a6c Mon Sep 17 00:00:00 2001 From: Ritwik Puri Date: Thu, 20 Apr 2023 22:03:11 +0530 Subject: [PATCH] fix(patch): only run disable_email_accounts_with_oauth if connected user is not set (#20799) --- frappe/patches/v14_0/disable_email_accounts_with_oauth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/patches/v14_0/disable_email_accounts_with_oauth.py b/frappe/patches/v14_0/disable_email_accounts_with_oauth.py index d620bf4e3b..2066b5f640 100644 --- a/frappe/patches/v14_0/disable_email_accounts_with_oauth.py +++ b/frappe/patches/v14_0/disable_email_accounts_with_oauth.py @@ -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.