Commit 5f8a4acf authored by Jean-Paul Smets's avatar Jean-Paul Smets

Supports request.RESPONSE


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@468 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c61e903f
...@@ -150,7 +150,7 @@ class TemplateTool (BaseTool): ...@@ -150,7 +150,7 @@ class TemplateTool (BaseTool):
self.deleteContent(id) self.deleteContent(id)
self._importObjectFromFile(cStringIO.StringIO(export_string), id=id) self._importObjectFromFile(cStringIO.StringIO(export_string), id=id)
def download(self, url, id=None): def download(self, url, id=None, REQUEST=None):
""" """
Update an existing template Update an existing template
""" """
...@@ -158,5 +158,12 @@ class TemplateTool (BaseTool): ...@@ -158,5 +158,12 @@ class TemplateTool (BaseTool):
file, headers = urlretrieve(url) file, headers = urlretrieve(url)
if id is None: id = self.generateNewId() if id is None: id = self.generateNewId()
self._importObjectFromFile(file, id=id) self._importObjectFromFile(file, id=id)
bt = self[id]
bt.id = id # Make sure id is consistent
bt.immediateReindexObject()
if REQUEST is not None:
REQUEST.RESPONSE.redirect("%s?portal_status_message=Business+Template+Downloaded+Successfully"
% self.absolute_url())
InitializeClass(TemplateTool) InitializeClass(TemplateTool)
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