From 3b8d588f3d447c31f9526bc6ff00a2dee1137278 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 5 Nov 2012 13:28:30 +0530 Subject: [PATCH] if recipients only then try to send email digest --- setup/doctype/email_digest/email_digest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup/doctype/email_digest/email_digest.py b/setup/doctype/email_digest/email_digest.py index 9c5a24f1cc..017001d44b 100644 --- a/setup/doctype/email_digest/email_digest.py +++ b/setup/doctype/email_digest/email_digest.py @@ -56,10 +56,11 @@ class DocType: recipients = filter(lambda r: r in valid_users, self.doc.recipient_list.split("\n")) - from webnotes.utils.email_lib import sendmail - sendmail(recipients=recipients, subject=(self.doc.frequency + " Digest"), - sender="ERPNext Notifications ", - msg=self.get_digest_msg()) + if recipients: + from webnotes.utils.email_lib import sendmail + sendmail(recipients=recipients, subject=(self.doc.frequency + " Digest"), + sender="ERPNext Notifications ", + msg=self.get_digest_msg()) def get_digest_msg(self): """"""