Commit e4e1a888 authored by Romain Courteaud's avatar Romain Courteaud

Test is recipient is None before wrapping it with a list.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19260 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ad96fe6
...@@ -183,10 +183,6 @@ class NotificationTool(BaseTool): ...@@ -183,10 +183,6 @@ class NotificationTool(BaseTool):
# we fallback to default values # we fallback to default values
email_from_address = default_from_email 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 # If no recipient is defined, just send an email to the
# default mail address defined at the CMF site root. # default mail address defined at the CMF site root.
if recipient is None: if recipient is None:
...@@ -198,6 +194,10 @@ class NotificationTool(BaseTool): ...@@ -198,6 +194,10 @@ class NotificationTool(BaseTool):
attachment_list=attachment_list) attachment_list=attachment_list)
return mailhost.send(mail_message.as_string(), default_to_email, email_from_address) 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 # Default implementation is to send an active message to everyone
for person in recipient: for person in recipient:
if isinstance(person, basestring): if isinstance(person, basestring):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment