changeset 6078:35473fe0967d

line wrap at 120 chars instead of 80
author 'Karl O. Pinc' <kop@meme.com>
date Tue, 16 Sep 2014 08:40:47 -0500
parents 464b6cd93ba3
children dca00e9c5bcd
files MoinMoin/PageEditor.py MoinMoin/action/newpage.py MoinMoin/action/revert.py MoinMoin/auth/__init__.py MoinMoin/wsgiapp.py
diffstat 5 files changed, 15 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Mon Sep 15 23:18:52 2014 -0500
+++ b/MoinMoin/PageEditor.py	Tue Sep 16 08:40:47 2014 -0500
@@ -169,12 +169,10 @@
 
         # check edit permissions
         if not request.user.may.write(self.page_name):
-            log_attempt('edit/no permissions', False, request,
-                        pagename=self.page_name)
+            log_attempt('edit/no permissions', False, request, pagename=self.page_name)
             msg = _('You are not allowed to edit this page.')
         elif not self.isWritable():
-            log_attempt('edit/immutable', False, request,
-                        pagename=self.page_name)
+            log_attempt('edit/immutable', False, request, pagename=self.page_name)
             msg = _('Page is immutable!')
         elif self.rev:
             # Trying to edit an old version, this is not possible via
@@ -556,8 +554,7 @@
             return False, _("You can't copy to an empty pagename.")
 
         if not self.request.user.may.write(newpagename):
-            log_attempt('copy/no permissions', False, request,
-                        pagename=self.page_name)
+            log_attempt('copy/no permissions', False, request, pagename=self.page_name)
             return False, _('You are not allowed to copy this page!')
 
         newpage = PageEditor(request, newpagename)
@@ -610,8 +607,7 @@
 
         if not (request.user.may.delete(self.page_name)
                 and request.user.may.write(newpagename)):
-            log_attempt('rename/no permissions', False, request,
-                        pagename=self.page_name)
+            log_attempt('rename/no permissions', False, request, pagename=self.page_name)
             msg = _('You are not allowed to rename this page!')
             raise self.AccessDenied(msg)
 
@@ -719,8 +715,7 @@
         success = True
         if not (request.user.may.write(self.page_name)
                 and request.user.may.delete(self.page_name)):
-            log_attempt('delete/no permissions', False, request,
-                        pagename=self.page_name)
+            log_attempt('delete/no permissions', False, request, pagename=self.page_name)
             msg = _('You are not allowed to delete this page!')
             raise self.AccessDenied(msg)
 
@@ -1085,13 +1080,11 @@
 
         msg = ""
         if not request.user.may.save(self, newtext, rev, **kw):
-            log_attempt('save/no permissions', False, request,
-                        pagename=self.page_name)
+            log_attempt('save/no permissions', False, request, pagename=self.page_name)
             msg = _('You are not allowed to edit this page!')
             raise self.AccessDenied(msg)
         elif not self.isWritable():
-            log_attempt('save/immutable', False, request,
-                        pagename=self.page_name)
+            log_attempt('save/immutable', False, request, pagename=self.page_name)
             msg = _('Page is immutable!')
             raise self.Immutable(msg)
         elif not newtext:
@@ -1135,8 +1128,7 @@
             if (not request.user.may.admin(self.page_name) and
                 parseACL(request, newtext).acl != acl.acl and
                 action != "SAVE/REVERT"):
-                log_attempt('acl change/no permissions', False, request,
-                            pagename=self.page_name)
+                log_attempt('acl change/no permissions', False, request, pagename=self.page_name)
                 msg = _("You can't change ACLs on this page since you have no admin rights on it!")
                 raise self.NoAdmin(msg)
 
--- a/MoinMoin/action/newpage.py	Mon Sep 15 23:18:52 2014 -0500
+++ b/MoinMoin/action/newpage.py	Tue Sep 16 08:40:47 2014 -0500
@@ -66,8 +66,7 @@
         page = Page(self.request, self.pagename)
         if not (page.isWritable() and self.request.user.may.read(self.pagename)):
             # Same error as the edit page for localization reasons
-            log_attempt('newpage/immutable or no permissions', False,
-                        self.request, pagename=self.pagename)
+            log_attempt('newpage/immutable or no permissions', False, self.request, pagename=self.pagename)
             return _('You are not allowed to edit this page.')
         return ''
 
--- a/MoinMoin/action/revert.py	Mon Sep 15 23:18:52 2014 -0500
+++ b/MoinMoin/action/revert.py	Tue Sep 16 08:40:47 2014 -0500
@@ -34,8 +34,7 @@
         may = self.request.user.may
         allowed = may.write(self.pagename) and may.revert(self.pagename)
         if not allowed:
-            log_attempt('revert/immutable or no permissions', False,
-                        self.request, pagename=self.pagename)
+            log_attempt('revert/immutable or no permissions', False, self.request, pagename=self.pagename)
         return allowed, _('You are not allowed to revert this page!')
 
     def check_condition(self):
--- a/MoinMoin/auth/__init__.py	Mon Sep 15 23:18:52 2014 -0500
+++ b/MoinMoin/auth/__init__.py	Tue Sep 16 08:40:47 2014 -0500
@@ -474,8 +474,7 @@
         uid = request.session['setuid']
         userobj = user.User(request, uid, auth_method='setuid')
         userobj.valid = True
-        log_attempt("auth/login (setuid from %r)" % old_user.name,
-                    True, request, userobj.name)
+        log_attempt("auth/login (setuid from %r)" % old_user.name, True, request, userobj.name)
     logging.debug("setup_suid returns %r, %r" % (userobj, old_user))
     return (userobj, old_user)
 
--- a/MoinMoin/wsgiapp.py	Mon Sep 15 23:18:52 2014 -0500
+++ b/MoinMoin/wsgiapp.py	Tue Sep 16 08:40:47 2014 -0500
@@ -174,11 +174,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 + '/action unavailable', False, request,
-                        context.user.name, pagename=pagename)
+            log_attempt(action_name + '/action unavailable', False, request, context.user.name, pagename=pagename)
         else:
-            log_attempt(action_name + '/action unavailable', False, request,
-                        pagename=pagename)
+            log_attempt(action_name + '/action unavailable', False, request, pagename=pagename)
             # Suggest non valid user to login
             msg += " " + _("Login and try again.")
 
@@ -193,11 +191,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, request, context.user.name, pagename=pagename)
             else:
-                log_attempt(action_name + '/no handler', False, request,
-                            pagename=pagename)
+                log_attempt(action_name + '/no handler', False, request, pagename=pagename)
                 # Suggest non valid user to login
                 msg += " " + _("Login and try again.")
             context.theme.add_msg(msg, "error")