Use the controller's symbolic/lookup name as part of the key for context hooks

This commit sponsored by David Collins.  Thank you!
This commit is contained in:
Christopher Allan Webber 2013-05-10 20:26:55 -05:00
parent e39feb041b
commit 98dacfe67e
2 changed files with 3 additions and 3 deletions

View File

@ -201,9 +201,9 @@ class MediaGoblinApp(object):
exc.get_description(environ))(environ, start_response)
controller = endpoint_to_controller(found_rule)
# Make a reference to the controller on the request...
# Make a reference to the controller's symbolic name on the request...
# used for lazy context modification
request.controller = controller
request.controller_name = found_rule.endpoint
# pass the request through our meddleware classes
try:

View File

@ -107,7 +107,7 @@ def render_template(request, template_path, context):
# allow plugins to do things to the context
context = hook_transform(
(request.controller, template_path),
(request.controller_name, template_path),
context)
rendered = template.render(context)