fix: Always return list from get_list_of_recipients

This commit is contained in:
Suraj Shetty 2020-09-18 11:59:34 +05:30 committed by GitHub
parent fc2fdbe426
commit f3132fa301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
return recipients