Commit 2a7b9960 authored by Jérome Perrin's avatar Jérome Perrin

xhtml_style: don't set content type header if already set

This is necessary on Zope4 because the error page is executed even if
the response already has a locked body - and in this case we don't
want to override the content-type header that might also have been set.

One user of this is Base_redirect from erp5_hal_json_style, when
abort_transaction is True, in that case it sets a body in json, a
content type header of application/json and then raise a redirect so
that the transaction is not commited. This fixes a problem visible on
Zope4 with erp5_bank_reconciliation_renderjs_ui_test:testFunctionalRJSBankReconciliationAction
parent 49a4182f
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
global current_action python: portal.ERP5Site_getCurrentAction(current_url, actions); global current_action python: portal.ERP5Site_getCurrentAction(current_url, actions);
cancel_url request/cancel_url | current_url; cancel_url request/cancel_url | current_url;
dummy python: local_parameter_list.update({'cancel_url': cancel_url}); dummy python: local_parameter_list.update({'cancel_url': cancel_url});
dummy python: request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=utf-8'); dummy python: request.RESPONSE.getHeader('Content-Type') or request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=utf-8');
dummy python: request.set('here', here); dummy python: request.set('here', here);
global css_list css_list | python:[]; global css_list css_list | python:[];
dummy python:css_list.extend(['%s/%s' % (portal_path, x) for x in portal.ERP5Site_getCssRelativeUrlList()]); dummy python:css_list.extend(['%s/%s' % (portal_path, x) for x in portal.ERP5Site_getCssRelativeUrlList()]);
......
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