aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/template.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-05-15 11:11:24 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-05-15 11:11:24 -0500
commit1c6d2e87f7e0051f33b043e6e0de41ee66ae304b (patch)
tree85add8efb02392bd39e9971474735010e2ce16e5 /mediagoblin/tools/template.py
parent0553976187a4ec870f944d2d4d17a4951075d2a8 (diff)
downloadmediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.tar.lz
mediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.tar.xz
mediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.zip
Oh right, actually add that hook we just documented, "template_context_prerender" :)
This commit sponsored by William Goudie. Thanks Bill! :)
Diffstat (limited to 'mediagoblin/tools/template.py')
-rw-r--r--mediagoblin/tools/template.py7
1 files changed, 7 insertions, 0 deletions
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: