changeset 3008:f8738a94d990

fix attachment_link of docbook formatter (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 19:08:54 +0100
parents 102a7ca14a64
children e67e97ad578f
files MoinMoin/formatter/text_docbook.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/text_docbook.py	Sun Jan 06 19:07:14 2008 +0100
+++ b/MoinMoin/formatter/text_docbook.py	Sun Jan 06 19:08:54 2008 +0100
@@ -396,12 +396,12 @@
 ### Attachments ######################################################
 
     def attachment_link(self, on, url=None, **kw):
-        _ = self.request.getText
-        pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
-        fname = wikiutil.taintfilename(filename)
-        target = AttachFile.getAttachUrl(pagename, filename, self.request)
+        assert on in (0, 1, False, True) # make sure we get called the new way, not like the 1.5 api was
         # we do not output a "upload link" when outputting docbook
         if on:
+            pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
+            fname = wikiutil.taintfilename(filename)
+            target = AttachFile.getAttachUrl(pagename, filename, self.request)
             return self.url(1, target, title="attachment:%s" % url)
         else:
             return self.url(0)