Commit 61f40a92 authored by Yoshinori Okuji's avatar Yoshinori Okuji

If REQUEST is not passed, try to get a REQUEST object from self.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3983 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5e5c1195
......@@ -174,6 +174,9 @@ class TemplateTool (BaseTool):
"""
Update an existing template
"""
if REQUEST is None:
REQUEST = getattr(self, 'REQUEST', None)
from urllib import urlretrieve
file, headers = urlretrieve(url)
self._importObjectFromFile(file, id=id)
......@@ -190,6 +193,9 @@ class TemplateTool (BaseTool):
"""
Update an existing template
"""
if REQUEST is None:
REQUEST = getattr(self, 'REQUEST', None)
if (import_file is None) or (len(import_file.read()) == 0) :
if REQUEST is not None :
REQUEST.RESPONSE.redirect("%s?portal_status_message=No+file+or+an+empty+file+was+specified"
......
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