From 01618e7be5084147d8ce3dcd35a249fb6f8acbcc Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Fri, 14 Jul 2017 12:49:53 +0200 Subject: [PATCH] pyramid: expose a temporary TemplateContext under `_c` --- rhodecode/apps/_base/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rhodecode/apps/_base/__init__.py b/rhodecode/apps/_base/__init__.py index 34bd48b0..412481da 100644 --- a/rhodecode/apps/_base/__init__.py +++ b/rhodecode/apps/_base/__init__.py @@ -137,6 +137,10 @@ class BaseAppView(object): local_tmpl_args = { 'defaults': {}, 'errors': {}, + # register a fake 'c' to be used in templates instead of global + # pylons c, after migration to pyramid we should rename it to 'c' + # make sure we replace usage of _c in templates too + '_c': tmpl_args } local_tmpl_args.update(tmpl_args) return local_tmpl_args