]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/handlers.py
Accepting incoming merge (branches/carpenter->trunk). Incorporates fixes to the...
[osqa.git] / forum_modules / pgfulltext / handlers.py
index 9d8f954c7e85fd700de6b3de0c04df06a0ca091b..780bfa97e60cf687b5d2f24b8c400124a7fbbb87 100644 (file)
@@ -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)