From 1f2de68379538446db39ebe151f5d25b948dde0e Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sun, 11 Apr 2004 12:16:35 +0000
Subject: [PATCH] only send notification if email defined

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@664 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/ActivityTool.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/product/CMFActivity/ActivityTool.py b/product/CMFActivity/ActivityTool.py
index 91e40c9f51..b399c4ea6c 100755
--- a/product/CMFActivity/ActivityTool.py
+++ b/product/CMFActivity/ActivityTool.py
@@ -130,7 +130,8 @@ class Message:
 
   def notifyUser(self, activity_tool, message="Failed Processing Activity"):
     user_email = activity_tool.portal_memberdata.getProperty('email')
-    mail_text = """From: %s
+    if user_email:
+      mail_text = """From: %s
 To: %s
 Subject: %s
 
@@ -140,7 +141,7 @@ Document: %s
 Method: %s
     """ % (activity_tool.email_from_address, user_email,
            message, message, '/'.join(self.object_path), self.method_id)
-    activity_tool.MailHost.send( mail_text )
+      activity_tool.MailHost.send( mail_text )
 
 class Method:
 
-- 
2.30.9