Commit 33560638 authored by Jérome Perrin's avatar Jérome Perrin

in unsuscribe, only redirect if we are called with a RESPONSE object (ie as a form action)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9222 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 415b16b2
...@@ -363,7 +363,7 @@ class ActivityTool (Folder, UniqueObject): ...@@ -363,7 +363,7 @@ class ActivityTool (Folder, UniqueObject):
return self.REQUEST.RESPONSE.redirect(url) return self.REQUEST.RESPONSE.redirect(url)
security.declareProtected(Permissions.manage_properties, 'unsubscribe') security.declareProtected(Permissions.manage_properties, 'unsubscribe')
def unsubscribe(self): def unsubscribe(self, REQUEST=None, RESPONSE=None):
""" unsubscribe from the global Timer Service """ """ unsubscribe from the global Timer Service """
service = getTimerService(self) service = getTimerService(self)
url = '%s/manageLoadBalancing?manage_tabs_message=' %self.absolute_url() url = '%s/manageLoadBalancing?manage_tabs_message=' %self.absolute_url()
...@@ -373,7 +373,8 @@ class ActivityTool (Folder, UniqueObject): ...@@ -373,7 +373,8 @@ class ActivityTool (Folder, UniqueObject):
else: else:
service.unsubscribe(self) service.unsubscribe(self)
url += urllib.quote("Unsubscribed from Timer Service") url += urllib.quote("Unsubscribed from Timer Service")
return self.REQUEST.RESPONSE.redirect(url) if RESPONSE is not None:
RESPONSE.redirect(url)
def manage_beforeDelete(self, item, container): def manage_beforeDelete(self, item, container):
self.unsubscribe() self.unsubscribe()
......
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