From 46c4f7ba31c1a20c4cfc88c18c618f10443e4336 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Thu, 12 Sep 2019 16:05:27 +0530 Subject: [PATCH] fix: dont return admin and guest placeholder email --- frappe/core/doctype/role/role.py | 2 +- frappe/email/doctype/notification/notification.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frappe/core/doctype/role/role.py b/frappe/core/doctype/role/role.py index 1467eafc5d..7ce2537da3 100644 --- a/frappe/core/doctype/role/role.py +++ b/frappe/core/doctype/role/role.py @@ -31,7 +31,7 @@ def get_emails_from_role(role): for user in users: user_email, enabled = frappe.db.get_value("User", user.parent, ["email", "enabled"]) - if enabled: + if enabled and user_email not in ["admin@example.com", "guest@example.com"]: emails.append(user_email) return emails \ No newline at end of file diff --git a/frappe/email/doctype/notification/notification.py b/frappe/email/doctype/notification/notification.py index 8032e020d7..f8d3002a2c 100644 --- a/frappe/email/doctype/notification/notification.py +++ b/frappe/email/doctype/notification/notification.py @@ -309,9 +309,7 @@ def evaluate_alert(doc, alert, event): else: raise db_value = parse_val(db_value) - if (doc.get(alert.value_changed) == db_value) or \ - (not db_value and not doc.get(alert.value_changed)): - + if (doc.get(alert.value_changed) == db_value) or (not db_value and not doc.get(alert.value_changed)): return # value not changed if event != "Value Change" and not doc.is_new():