Attachment 'packages_do_add_revision.patch'

Download

   1 diff -r 1f6f713c526c MoinMoin/packages.py
   2 --- a/MoinMoin/packages.py	Sat Sep 13 15:46:51 2008 +0200
   3 +++ b/MoinMoin/packages.py	Sat Sep 13 17:19:06 2008 +0200
   4 @@ -292,23 +292,24 @@
   5          @param comment:  comment related to this revision (optional)
   6          @param trivial:  boolean, if it is a trivial edit
   7          """
   8 +        _ = self.request.getText
   9 +        trivial = str2boolean(trivial)
  10 +        uid = user.getUserId(self.request, author)
  11 +        theuser = user.User(self.request, uid)
  12 +        save_user = self.request.user
  13 +        self.request.user = theuser
  14          if self.request.user.may.write(pagename):
  15 -            _ = self.request.getText
  16 -            trivial = str2boolean(trivial)
  17 -            uid = user.getUserId(self.request, author)
  18 -            theuser = user.User(self.request, uid)
  19 -            save_user = self.request.user
  20 -            self.request.user = theuser
  21              page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author)
  22              try:
  23                  page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment)
  24 -                self.msg += u"%(pagename)s added \n" % {"pagename": pagename}
  25              except PageEditor.Unchanged:
  26                  pass
  27 -            self.request.user = save_user
  28 -            page.clean_acl_cache()
  29 +            else:
  30 +                self.msg += u"%(pagename)s added \n" % {"pagename": pagename}
  31 +                page.clean_acl_cache()
  32          else:
  33 -            self.msg += u"action add revision: not enough rights - nothing done \n"
  34 +            self.msg += u"action add revision: not enough rights for %(author)s - nothing done \n" % {"author": author}
  35 +        self.request.user = save_user
  36  
  37      def do_renamepage(self, pagename, newpagename, author=u"Scripting Subsystem", comment=u"Renamed by the scripting subsystem."):
  38          """ Renames a page.

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-09-13 15:21:41, 1.9 KB) [[attachment:packages_do_add_revision.patch]]
  • [get | view] (2008-09-13 15:37:47, 1.4 KB) [[attachment:packages_do_add_revision2.patch]]
  • [get | view] (2008-09-13 16:21:34, 1.5 KB) [[attachment:packages_do_add_revision3.patch]]
  • [get | view] (2008-09-13 15:46:49, 5.6 KB) [[attachment:traceback.txt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.