diff MoinMoin/action/AttachFile.py @ 5588:4a50a70af35d

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 25 Feb 2010 17:26:36 +0100
parents 069f75c3d59c c68058eaa6be
children 1dff6cfdcf90
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Feb 25 11:43:26 2010 +0100
+++ b/MoinMoin/action/AttachFile.py	Thu Feb 25 17:26:36 2010 +0100
@@ -120,7 +120,12 @@
                       'move', # renders rename form, which has own ticket
             ]:
             # create a ticket for the not so harmless operations
-            args['ticket'] = wikiutil.createTicket(request)
+            # we need action= here because the current action (e.g. "show" page
+            # with a macro AttachList) may not be the linked-to action, e.g.
+            # "AttachFile". Also, AttachList can list attachments of another page,
+            # thus we need to give pagename= also.
+            args['ticket'] = wikiutil.createTicket(request,
+                                                   pagename=pagename, action=action_name)
         url = request.href(pagename, **args)
         return url
 
@@ -378,7 +383,7 @@
 
             try:
                 is_zipfile = zipfile.is_zipfile(fullpath)
-                if is_zipfile:
+                if is_zipfile and not readonly:
                     is_package = packages.ZipPackage(request, fullpath).isPackage()
                     if is_package and request.user.isSuperUser():
                         links.append(fmt.url(1, getAttachUrl(pagename, file, request, do='install')) +