From 0f12b5a9af70c230cb444dd37e6c6c0fabbc7318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 6 Oct 2018 16:56:04 +0200 Subject: [PATCH 2/2] misc: only expose all variables in global namespace in legacy templates (#.....) --- wcs/qommon/template.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wcs/qommon/template.py b/wcs/qommon/template.py index 19afabe2b..b9372e947 100644 --- a/wcs/qommon/template.py +++ b/wcs/qommon/template.py @@ -353,7 +353,6 @@ def get_decorate_vars(body, response, generate_breadcrumb=True, **kwargs): breadcrumb = ' > '.join(s) vars = response.filter.copy() - vars.update(get_publisher().substitutions.get_context_variables()) vars.update(locals()) return vars @@ -406,10 +405,12 @@ def decorate(body, response): template = default_template fd = StringIO() - vars = get_decorate_vars(body, response, - generate_breadcrumb=generate_breadcrumb) + context = {} + context.update(get_publisher().substitutions.get_context_variables()) + context.update(get_decorate_vars(body, response, + generate_breadcrumb=generate_breadcrumb)) - template.generate(fd, vars) + template.generate(fd, context) return fd.getvalue() -- 2.19.0