From: Christopher Allan Webber Date: Sat, 11 May 2013 01:26:55 +0000 (-0500) Subject: Use the controller's symbolic/lookup name as part of the key for context hooks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=98dacfe67e40eb3c575b2fb9a5a80ced3e284ddc;p=mediagoblin.git Use the controller's symbolic/lookup name as part of the key for context hooks This commit sponsored by David Collins. Thank you! --- diff --git a/mediagoblin/app.py b/mediagoblin/app.py index dc2900a9..3ebaa45b 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -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: diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py index 84fdabf2..950fb5da 100644 --- a/mediagoblin/tools/template.py +++ b/mediagoblin/tools/template.py @@ -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)