]> git.openstreetmap.org Git - osqa.git/commitdiff
#OSQA-581, adding the reset cache count funtionality to the maintaindb command. Now...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 9 Apr 2011 20:25:53 +0000 (20:25 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 9 Apr 2011 20:25:53 +0000 (20:25 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@955 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/management/commands/maintaindb.py

index a2fc8de17ba82218fe6759d7884de077bab43cde..26a12ff15d0a240387010b9fbac29017f876055f 100644 (file)
@@ -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