Commit 980685dd authored by Sebastien Robin's avatar Sebastien Robin

do not set headers while requesting the source

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39404 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cb543ed9
...@@ -557,7 +557,7 @@ class OOoTemplate(ZopePageTemplate): ...@@ -557,7 +557,7 @@ class OOoTemplate(ZopePageTemplate):
if batch_mode: if batch_mode:
ooo = ooo_builder.render() ooo = ooo_builder.render()
else: else:
ooo = ooo_builder.render(name=self.title or self.id) ooo = ooo_builder.render(name=self.title or self.id, source=source)
if DevelopmentMode: if DevelopmentMode:
# Validate XML in development mode # Validate XML in development mode
......
...@@ -199,12 +199,12 @@ class OOoBuilder(Implicit): ...@@ -199,12 +199,12 @@ class OOoBuilder(Implicit):
is_legacy = ('oasis.opendocument' not in self.getMimeType()) is_legacy = ('oasis.opendocument' not in self.getMimeType())
return "%s%s" % (is_legacy and '#' or '', name,) return "%s%s" % (is_legacy and '#' or '', name,)
def render(self, name='', extension='sxw'): def render(self, name='', extension='sxw', source=False):
""" """
returns the OOo document returns the OOo document
""" """
request = get_request() request = get_request()
if name: if name and not(source):
request.response.setHeader('Content-Disposition', request.response.setHeader('Content-Disposition',
'attachment; filename=%s.%s' % (name, extension)) 'attachment; filename=%s.%s' % (name, extension))
......
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