From 5d97c2b1944bd296c124eae88564f2e72562aacc Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 4 Apr 2008 07:54:17 +0000 Subject: [PATCH] Fixed minor bug in initdb that caused initial anonymous user creation with owner permission to main notebook. Fixed variable shadowing bug when picking out notebook to use in header "my wiki" link. --- model/drop.sql | 1 + tools/initdb.py | 2 +- view/Main_page.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/model/drop.sql b/model/drop.sql index 861170a..3aee9c7 100644 --- a/model/drop.sql +++ b/model/drop.sql @@ -8,3 +8,4 @@ DROP TABLE password_reset; DROP TABLE user_notebook; DROP TABLE invite; DROP TABLE file; +DROP FUNCTION drop_html_tags( text ); diff --git a/tools/initdb.py b/tools/initdb.py index 109d3e3..8336161 100644 --- a/tools/initdb.py +++ b/tools/initdb.py @@ -66,7 +66,7 @@ class Initializer( object ): self.database.save( self.anonymous, commit = False ) # give the anonymous user read-only access to the main notebook - self.database.execute( self.anonymous.sql_save_notebook( self.main_notebook.object_id, read_write = False ), commit = False ) + self.database.execute( self.anonymous.sql_save_notebook( self.main_notebook.object_id, read_write = False, owner = False ), commit = False ) def main( args = None ): diff --git a/view/Main_page.py b/view/Main_page.py index 158a247..4746d7b 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -101,7 +101,7 @@ class Main_page( Page ): "Luminotes privacy policy": "privacy", }.get( header_note_title, header_note_title ) - own_notebooks = [ notebook for notebook in notebooks if notebook.read_write is True ] + own_notebooks = [ nb for nb in notebooks if nb.read_write is True ] header_notebook = own_notebooks and own_notebooks[ 0 ] or notebook Page.__init__(