diff MoinMoin/action/AttachFile.py @ 1479:b1562b232683

fix for deleting from xapian index
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Thu, 24 Aug 2006 15:33:44 +0200
parents b5864c9492fb
children 0d89219ff974
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Aug 24 15:25:15 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Thu Aug 24 15:33:44 2006 +0200
@@ -645,6 +645,12 @@
     os.remove(fpath)
     _addLogEntry(request, 'ATTDEL', pagename, filename)
 
+    if request.cfg.xapian_search:
+        from MoinMoin.search.Xapian import Index
+        index = Index(request)
+        if index.exists:
+            index.remove_item(pagename, filename)
+
     upload_form(pagename, request, msg=_("Attachment '%(filename)s' deleted.") % {'filename': filename})