changeset 6080:236f7a9370c4

context always has context.request, no need to pass a request param
author 'Karl O. Pinc' <kop@meme.com>
date Tue, 16 Sep 2014 09:22:19 -0500
parents dca00e9c5bcd
children 3253536f55fe
files MoinMoin/wsgiapp.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wsgiapp.py	Tue Sep 16 08:41:46 2014 -0500
+++ b/MoinMoin/wsgiapp.py	Tue Sep 16 09:22:19 2014 -0500
@@ -134,12 +134,12 @@
         response = redirect_last_visited(context)
     # 2. handle action
     else:
-        response = handle_action(request, context, pagename, action_name)
+        response = handle_action(context, pagename, action_name)
     if isinstance(response, Context):
         response = response.request
     return response
 
-def handle_action(request, context, pagename, action_name='show'):
+def handle_action(context, pagename, action_name='show'):
     """ Actual dispatcher function for non-XMLRPC actions.
 
     Also sets up the Page object for this request, normalizes and
@@ -174,9 +174,10 @@
         msg = _("You are not allowed to do %(action_name)s on this page.") % {
                 'action_name': wikiutil.escape(action_name), }
         if context.user.valid:
-            log_attempt(action_name + '/action unavailable', False, request, context.user.name, pagename=pagename)
+            log_attempt(action_name + '/action unavailable', False,
+                        context.request, context.user.name, pagename=pagename)
         else:
-            log_attempt(action_name + '/action unavailable', False, request, pagename=pagename)
+            log_attempt(action_name + '/action unavailable', False, context.request, pagename=pagename)
             # Suggest non valid user to login
             msg += " " + _("Login and try again.")
 
@@ -191,9 +192,9 @@
             msg = _("You are not allowed to do %(action_name)s on this page.") % {
                     'action_name': wikiutil.escape(action_name), }
             if context.user.valid:
-                log_attempt(action_name + '/no handler', False, request, context.user.name, pagename=pagename)
+                log_attempt(action_name + '/no handler', False, context.request, context.user.name, pagename=pagename)
             else:
-                log_attempt(action_name + '/no handler', False, request, pagename=pagename)
+                log_attempt(action_name + '/no handler', False, context.request, pagename=pagename)
                 # Suggest non valid user to login
                 msg += " " + _("Login and try again.")
             context.theme.add_msg(msg, "error")