From: Christopher Allan Webber Date: Wed, 15 May 2013 16:11:24 +0000 (-0500) Subject: Oh right, actually add that hook we just documented, "template_context_prerender" :) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1c6d2e87f7e0051f33b043e6e0de41ee66ae304b;p=mediagoblin.git Oh right, actually add that hook we just documented, "template_context_prerender" :) This commit sponsored by William Goudie. Thanks Bill! :) --- diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py index aab571f0..3d651a6e 100644 --- a/mediagoblin/tools/template.py +++ b/mediagoblin/tools/template.py @@ -113,6 +113,13 @@ def render_template(request, template_path, context): (request.controller_name, template_path), context) + # More evil: allow plugins to possibly do something to the context + # in every request ever with access to the request and other + # variables. Note: this is slower than using + # template_global_context + context = hook_transform( + 'template_context_prerender', context) + rendered = template.render(context) if common.TESTS_ENABLED: