Commit 5e4a412f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Never set response headers if batch mode.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17582 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 882a9628
...@@ -479,7 +479,10 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> ...@@ -479,7 +479,10 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
ooo_builder.updateManifest() ooo_builder.updateManifest()
# Produce final result # Produce final result
ooo = ooo_builder.render(name=self.title or self.id) if batch_mode:
ooo = ooo_builder.render()
else:
ooo = ooo_builder.render(name=self.title or self.id)
format = opts.get('format', request.get('format', None)) format = opts.get('format', request.get('format', None))
if format: if format:
...@@ -488,9 +491,6 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> ...@@ -488,9 +491,6 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
if not format and not batch_mode: if not format and not batch_mode:
request.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % self.content_type) request.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % self.content_type)
request.RESPONSE.setHeader('Content-disposition', 'inline;filename=%s' % self.title_or_id()) request.RESPONSE.setHeader('Content-disposition', 'inline;filename=%s' % self.title_or_id())
else:
request.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % 'text/html')
request.RESPONSE.setHeader('Content-disposition', 'inline;filename=%s' % self.title_or_id())
return ooo return ooo
...@@ -540,8 +540,8 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> ...@@ -540,8 +540,8 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
REQUEST.RESPONSE.setHeader('Content-type', 'application/pdf') REQUEST.RESPONSE.setHeader('Content-type', 'application/pdf')
REQUEST.RESPONSE.setHeader('Content-disposition', 'attachment;filename=%s.pdf' % self.title_or_id()) REQUEST.RESPONSE.setHeader('Content-disposition', 'attachment;filename=%s.pdf' % self.title_or_id())
return data return data
mime , data = tmp_ooo.convert(format) mime, data = tmp_ooo.convert(format)
if REQUEST is not None: if REQUEST is not None and not batch_mode:
REQUEST.RESPONSE.setHeader('Content-type', mime) REQUEST.RESPONSE.setHeader('Content-type', mime)
REQUEST.RESPONSE.setHeader('Content-disposition', 'attachment;filename=%s.%s' % (self.title_or_id(),format)) REQUEST.RESPONSE.setHeader('Content-disposition', 'attachment;filename=%s.%s' % (self.title_or_id(),format))
# FIXME the above lines should return zip format when html was requested # FIXME the above lines should return zip format when html was requested
......
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