X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c6c168511f18d8984901b2c828a47310a2d54d64..b48485bf3bf42feb7d189d55d2551c40d75bd992:/forum/management/commands/maintaindb.py diff --git a/forum/management/commands/maintaindb.py b/forum/management/commands/maintaindb.py index a2fc8de..c41d36b 100644 --- a/forum/management/commands/maintaindb.py +++ b/forum/management/commands/maintaindb.py @@ -30,7 +30,7 @@ def create_revision(node): tagnames = node.tagnames, title = node.title, ) - + rev.save() node.save() return node @@ -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