From 5e4a412fdb6226e5f7b954d617740386fcbf122c Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Wed, 14 Nov 2007 14:33:03 +0000 Subject: [PATCH] Never set response headers if batch mode. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17582 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5OOo/OOoTemplate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/product/ERP5OOo/OOoTemplate.py b/product/ERP5OOo/OOoTemplate.py index 1a0eab5be8..b560742e9d 100644 --- a/product/ERP5OOo/OOoTemplate.py +++ b/product/ERP5OOo/OOoTemplate.py @@ -479,7 +479,10 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> ooo_builder.updateManifest() # 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)) if format: @@ -488,9 +491,6 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> if not format and not batch_mode: request.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % self.content_type) 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 @@ -540,8 +540,8 @@ xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> REQUEST.RESPONSE.setHeader('Content-type', 'application/pdf') REQUEST.RESPONSE.setHeader('Content-disposition', 'attachment;filename=%s.pdf' % self.title_or_id()) return data - mime , data = tmp_ooo.convert(format) - if REQUEST is not None: + mime, data = tmp_ooo.convert(format) + if REQUEST is not None and not batch_mode: REQUEST.RESPONSE.setHeader('Content-type', mime) 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 -- 2.30.9