misc: do not convert non html body (#36515)

This commit is contained in:
Frédéric Péters 2019-11-13 11:59:36 +01:00
parent 5a4302b461
commit 4e6f21ef43
1 changed files with 4 additions and 2 deletions

View File

@ -247,9 +247,11 @@ def get_default_ezt_template():
def get_decorate_vars(body, response, generate_breadcrumb=True, **kwargs):
from .publisher import get_cfg
body = str(body)
if response.content_type != 'text/html':
return {'body': body}
if get_request().get_header('x-popup') == 'true' or response.content_type != 'text/html':
body = str(body)
if get_request().get_header('x-popup') == 'true':
return {'body': body}
kwargs = {}