From f3132fa301480ea615b70d8b644fe0366b52e243 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 18 Sep 2020 11:59:34 +0530 Subject: [PATCH] fix: Always return list from get_list_of_recipients --- frappe/email/doctype/notification/notification.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/email/doctype/notification/notification.py b/frappe/email/doctype/notification/notification.py index 18ec760c77..df4b7ad44c 100644 --- a/frappe/email/doctype/notification/notification.py +++ b/frappe/email/doctype/notification/notification.py @@ -169,9 +169,11 @@ def get_context(context): attachments = self.get_attachment(doc) recipients, cc, bcc = self.get_list_of_recipients(doc, context) - if not (recipients or cc or bcc): - return + users = recipients + cc + bcc + + if not users: + return notification_doc = { 'type': 'Alert', @@ -277,8 +279,6 @@ def get_context(context): if self.send_to_all_assignees: recipients = recipients + get_assignees(doc) - if not recipients and not cc and not bcc: - return None, None, None return list(set(recipients)), list(set(cc)), list(set(bcc)) def get_receiver_list(self, doc, context): @@ -428,4 +428,4 @@ def get_assignees(doc): recipients = [d.owner for d in assignees] - return recipients \ No newline at end of file + return recipients