Projet

Général

Profil

0002-misc-only-expose-all-variables-in-global-namespace-i.patch

Frédéric Péters, 06 octobre 2018 17:44

Télécharger (1,36 ko)

Voir les différences:

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(-)
wcs/qommon/template.py
353 353
            breadcrumb = ' <span class="separator">&gt;</span> '.join(s)
354 354

  
355 355
    vars = response.filter.copy()
356
    vars.update(get_publisher().substitutions.get_context_variables())
357 356
    vars.update(locals())
358 357
    return vars
359 358

  
......
406 405
                template = default_template
407 406

  
408 407
    fd = StringIO()
409
    vars = get_decorate_vars(body, response,
410
            generate_breadcrumb=generate_breadcrumb)
408
    context = {}
409
    context.update(get_publisher().substitutions.get_context_variables())
410
    context.update(get_decorate_vars(body, response,
411
            generate_breadcrumb=generate_breadcrumb))
411 412

  
412
    template.generate(fd, vars)
413
    template.generate(fd, context)
413 414
    return fd.getvalue()
414 415

  
415 416

  
416
-