Use the controller's symbolic/lookup name as part of the key for context hooks
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 11 May 2013 01:26:55 +0000 (20:26 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 11 May 2013 01:26:55 +0000 (20:26 -0500)
This commit sponsored by David Collins.  Thank you!

mediagoblin/app.py
mediagoblin/tools/template.py

index dc2900a9780b40889805f75d3ab865bded7cfa39..3ebaa45bc501a4cff6f662c0138bc5a5d0aeb6eb 100644 (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:
index 84fdabf2399d6ae49f0ffa4e105e4c2bd30f80dc..950fb5daaa2d1ac97d1dfde99a63374b14be0563 100644 (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)