From adca110c901e2b20796748c445df140e2b198ff0 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 17 Mar 2008 23:15:18 +0000 Subject: [PATCH] Fixed to also set rank for anonymous user. --- tools/set_ranks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/set_ranks.py b/tools/set_ranks.py index 3084f44..5a7b16b 100755 --- a/tools/set_ranks.py +++ b/tools/set_ranks.py @@ -26,6 +26,16 @@ class Ranker( object ): self.database.execute( user.sql_update_notebook_rank( notebook.object_id, rank ), commit = False ) rank += 1 + users = self.database.select_many( User, u"select * from luminotes_user_current where username is not null and username = 'anonymous';" ) + user = users[ 0 ] + + # rank the notebooks for the anonymous user + rank = 0 + notebooks = self.database.select_many( Notebook, user.sql_load_notebooks( undeleted_only = True ) ) + + for notebook in notebooks: + self.database.execute( user.sql_update_notebook_rank( notebook.object_id, rank ), commit = False ) + rank += 1 def main( args ): database = Database()