changeset 5586:369a2c879eb6

attachUrl: fix wrongly generated tickets (e.g. for AttachList macro)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 25 Feb 2010 16:51:33 +0100
parents 1f638ed400a0
children c68058eaa6be 6e603e5411ca
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Feb 18 09:40:44 2010 +0100
+++ b/MoinMoin/action/AttachFile.py	Thu Feb 25 16:51:33 2010 +0100
@@ -83,7 +83,12 @@
             and
             kw.get('rename') is None):
         # create a ticket for the not so harmless operations
-        kw['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.
+        kw['ticket'] = wikiutil.createTicket(request,
+                                             pagename=pagename, action=action_name)
     if kw:
         qs = '?%s' % wikiutil.makeQueryString(kw, want_unicode=False)
     else: