X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c76406e46e71cb86cfb440667bfbbe21b36e709e..f4fc26a6e63e4fb5a1087da33509c0eefa0bc3bc:/forum_modules/pgfulltext/handlers.py?ds=sidebyside diff --git a/forum_modules/pgfulltext/handlers.py b/forum_modules/pgfulltext/handlers.py index 9d8f954..2b40266 100644 --- a/forum_modules/pgfulltext/handlers.py +++ b/forum_modules/pgfulltext/handlers.py @@ -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)