[Erp5-report] r19260 - /erp5/trunk/products/ERP5/Tool/NotificationTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 12 09:55:17 CET 2008


Author: romain
Date: Tue Feb 12 09:55:17 2008
New Revision: 19260

URL: http://svn.erp5.org?rev=19260&view=rev
Log:
Test is recipient is None before wrapping it with a list.

Modified:
    erp5/trunk/products/ERP5/Tool/NotificationTool.py

Modified: erp5/trunk/products/ERP5/Tool/NotificationTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/NotificationTool.py?rev=19260&r1=19259&r2=19260&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/NotificationTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/NotificationTool.py Tue Feb 12 09:55:17 2008
@@ -183,10 +183,6 @@
       # we fallback to default values
       email_from_address = default_from_email
 
-    # To is a list - let us find all members
-    if not isinstance(recipient, (list, tuple)):
-      recipient = (recipient, )
-
     # If no recipient is defined, just send an email to the
     # default mail address defined at the CMF site root.
     if recipient is None:
@@ -197,6 +193,10 @@
                                        msg=message, subject=subject,
                                        attachment_list=attachment_list)
       return mailhost.send(mail_message.as_string(), default_to_email, email_from_address)
+
+    elif not isinstance(recipient, (list, tuple)):
+      # To is a list - let us find all members
+      recipient = (recipient, )
 
     # Default implementation is to send an active message to everyone
     for person in recipient:




More information about the Erp5-report mailing list