changeset 5095:6024628e8d60

refactored getAttachURL
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 12 Sep 2009 21:40:56 +0200
parents 6cfcb25278a7
children c8ea1985d348
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Sep 12 19:16:05 2009 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Sep 12 21:40:56 2009 +0200
@@ -84,18 +84,13 @@
 
 def getAttachUrl(pagename, filename, request, addts=0, escaped=0, do='get', drawing='', upload=False):
     """ Get URL that points to attachment `filename` of page `pagename`. """
-    if upload:
-        if not drawing:
-            url = request.href(pagename, rename=wikiutil.taintfilename(filename),
-                               action=action_name)
+    if not drawing:
+        if upload:
+            url = request.href(pagename, action=action_name, rename=wikiutil.taintfilename(filename))
         else:
-            url = request.href(pagename,
-                               target=drawing, action=request.cfg.drawing_action)
+            url = request.href(pagename, action=action_name, do=do, target=filename)
     else:
-        if not drawing:
-            url = request.href(pagename, target=filename, action=action_name, do=do)
-        else:
-            url = request.href(pagename, target=drawing, action=request.cfg.drawing_action)
+        url = request.href(pagename, action=request.cfg.drawing_action, target=drawing)
     return url