changeset 3169:a654cf294f4e

AttachFile: fix _access_file return parameter count
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 02 Mar 2008 15:57:43 +0100
parents 0b0b756908c1
children 50147905729a
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sun Mar 02 15:35:32 2008 +0100
+++ b/MoinMoin/action/AttachFile.py	Sun Mar 02 15:57:43 2008 +0100
@@ -240,9 +240,9 @@
 
 def _access_file(pagename, request):
     """ Check form parameter `target` and return a tuple of
-        `(filename, filepath)` for an existing attachment.
+        `(pagename, filename, filepath)` for an existing attachment.
 
-        Return `(None, None)` if an error occurs.
+        Return `(pagename, None, None)` if an error occurs.
     """
     _ = request.getText
 
@@ -254,11 +254,11 @@
         fpath = getFilename(request, pagename, filename)
 
         if os.path.isfile(fpath):
-            return (filename, fpath)
+            return (pagename, filename, fpath)
         error = _("Attachment '%(filename)s' does not exist!") % {'filename': filename}
 
     error_msg(pagename, request, error)
-    return (None, None)
+    return (pagename, None, None)
 
 
 def _build_filelist(request, pagename, showheader, readonly, mime_type='*'):
@@ -943,7 +943,7 @@
     _ = request.getText
     fmt = request.html_formatter
 
-    filename, fpath = _access_file(pagename, request)
+    pagename, filename, fpath = _access_file(pagename, request)
     if not filename:
         return
 
@@ -1039,7 +1039,7 @@
 
     # send body
     request.write(request.formatter.startContent())
-    send_viewfile(pagename, request)
+    send_viewfile(orig_pagename, request)
     send_uploadform(pagename, request)
     request.write(request.formatter.endContent())