From: jordan Date: Sat, 9 Apr 2011 20:25:53 +0000 (+0000) Subject: #OSQA-581, adding the reset cache count funtionality to the maintaindb command. Now... X-Git-Tag: live~357 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/ae96bc747fb5bee82a2d5ebcab9a92b8a01408f2 #OSQA-581, adding the reset cache count funtionality to the maintaindb command. Now the site administrators are able to flush the cached count data in case something gets messy. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@955 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/management/commands/maintaindb.py b/forum/management/commands/maintaindb.py index a2fc8de..26a12ff 100644 --- a/forum/management/commands/maintaindb.py +++ b/forum/management/commands/maintaindb.py @@ -64,3 +64,12 @@ class Command(BaseCommand): activate_latest_revision(node) #print rev.node + + if node.node_type == "question": + # Reset the answer count cache + node.reset_answer_count_cache() + print "Question #%(question_id)d: Answer count cache has been reset" % { 'question_id' : node.id } + + # Reset the accepted count cache + node.reset_accepted_count_cache() + print "Question #%(question_id)d: Resetting the accepted count cache" % { 'question_id' : node.id } \ No newline at end of file