]> git.openstreetmap.org Git - osqa.git/commitdiff
Adds the hability to hard delete nodes in the bulk manager, and renames the tool.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Sep 2010 13:19:54 +0000 (13:19 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Sep 2010 13:19:54 +0000 (13:19 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@588 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/osqaadmin/nodeman.html
forum/views/admin.py
forum_modules/pgfulltext/handlers.py

index f96d13baeee69630f8df57588acd3930b0b97ce8..af8d1ce37d7038824a4d3a14b4cce05232694120 100644 (file)
                     <select name="action">
                         <option selected="selected" value="">---------</option>
                         <option value="delete_selected">{% trans "Mark deleted" %}</option>
-                        <!--<option value="hard_delete_selected">{% trans "Delete completelly" %}</option>-->
+                        <option value="hard_delete_selected">{% trans "Delete completelly" %}</option>
                         <option value="close_selected">{% trans "Close (questions only)" %}</option>
                     </select>
                 </label>
index ec770764bb8d99c0de0451708971fe015b83199c..0fa533366c13d83d3c5157bd73d6015558170a68 100644 (file)
@@ -418,7 +418,7 @@ class NodeManagementPaginatorContext(pagination.PaginatorContext):
             (_('act_at_asc'), pagination.SimpleSort(_('act_at_asc'), 'last_activity_at', "")),
         ), pagesizes=(default_pagesize,), force_sort='added_at', default_pagesize=default_pagesize, prefix=prefix)
 
-@admin_tools_page(_("nodeman"), _("Node management"))
+@admin_tools_page(_("nodeman"), _("Bulk management"))
 def node_management(request):
     if request.POST and "save_filter" in request.POST:
         filter_name = request.POST.get('filter_name', _('filter'))
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)