]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/handlers.py
Ignore active copies of setting files
[osqa.git] / forum_modules / pgfulltext / handlers.py
index 9d8f954c7e85fd700de6b3de0c04df06a0ca091b..2b402666c6429f70d816788d34cf058f907f8006 100644 (file)
@@ -12,7 +12,7 @@ def question_search(self, keywords):
     tsquery = " | ".join(word_re.findall(keywords))
     ilike = keywords + u"%%"
 
-    return True, self.extra(
+    return '-ranking', self.extra(
             tables = ['forum_rootnode_doc'],
             select={
             'ranking': """
@@ -28,18 +28,11 @@ def question_search(self, keywords):
             )
 
 
-def delete_docs(node):
-    cursor = connection.cursor()
-    cursor.execute("DELETE FROM forum_rootnode_doc WHERE node_id = %s" % (node.id))
-
-    for n in node.children.all():
-        delete_docs(n)
-
-
-#@decorate(Node.delete)
+@decorate(Node.delete)
 def delete(origin, self, *args, **kwargs):
-    delete_docs(self)
+    cursor = connection.cursor()
+    cursor.execute("DELETE FROM forum_rootnode_doc WHERE node_id = %s" % (self.id))
     transaction.commit_unless_managed()
-    origin(self, *args, **kwargs)
+    return origin(self, *args, **kwargs)