From 787816556073d2b34558440aff023cc5025e7efc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 9 Nov 2006 13:25:06 +0000
Subject: [PATCH] do not redirect when not called trought the web

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11230 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 2e51f29f26..0f612c39a4 100644
--- a/product/CMFActivity/ActivityTool.py
+++ b/product/CMFActivity/ActivityTool.py
@@ -350,7 +350,7 @@ class ActivityTool (Folder, UniqueObject):
         return False
 
     security.declareProtected(Permissions.manage_properties, 'subscribe')
-    def subscribe(self):
+    def subscribe(self, REQUEST=None, RESPONSE=None):
         """ subscribe to the global Timer Service """
         service = getTimerService(self)
         url = '%s/manageLoadBalancing?manage_tabs_message=' %self.absolute_url()
@@ -360,7 +360,8 @@ class ActivityTool (Folder, UniqueObject):
         else:
             service.subscribe(self)
             url += urllib.quote("Subscribed to Timer Service")
-        return self.REQUEST.RESPONSE.redirect(url)
+        if RESPONSE is not None:
+            RESPONSE.redirect(url)
 
     security.declareProtected(Permissions.manage_properties, 'unsubscribe')
     def unsubscribe(self, REQUEST=None, RESPONSE=None):
-- 
2.30.9