diff --git a/controller/Users.py b/controller/Users.py index 9224ce4..7335bc2 100644 --- a/controller/Users.py +++ b/controller/Users.py @@ -286,19 +286,10 @@ class Users( object ): ) return - # in addition to this user's own notebooks, add to that list the anonymous user's notebooks - if user_id: - self.__database.load( u"User anonymous", self.__scheduler.thread ) - anonymous = ( yield Scheduler.SLEEP ) - notebooks = anonymous.notebooks - else: - notebooks = [] - notebooks += user.notebooks - yield dict( user = user, - notebooks = notebooks, - startup_notes = include_startup_notes and len( notebooks ) > 0 and notebooks[ 0 ].startup_notes or [], + notebooks = user.notebooks, + startup_notes = include_startup_notes and len( user.notebooks ) > 0 and user.notebooks[ 0 ].startup_notes or [], http_url = self.__http_url, ) diff --git a/controller/test/Test_users.py b/controller/test/Test_users.py index cd80550..21e2b64 100644 --- a/controller/test/Test_users.py +++ b/controller/test/Test_users.py @@ -37,10 +37,16 @@ class Test_users( Test_controller ): self.database.next_id( self.scheduler.thread ) self.anon_notebook = Notebook( ( yield Scheduler.SLEEP ), u"anon notebook" ) + self.database.next_id( self.scheduler.thread ) - self.startup_note = Note( ( yield Scheduler.SLEEP ), u"contents go here" ) - self.anon_notebook.add_note( self.startup_note ) - self.anon_notebook.add_startup_note( self.startup_note ) + self.anon_startup_note = Note( ( yield Scheduler.SLEEP ), u"contents go here" ) + self.anon_notebook.add_note( self.anon_startup_note ) + self.anon_notebook.add_startup_note( self.anon_startup_note ) + + self.database.next_id( self.scheduler.thread ) + self.startup_note = Note( ( yield Scheduler.SLEEP ), u"other contents go here" ) + self.notebooks[ 0 ].add_note( self.startup_note ) + self.notebooks[ 0 ].add_startup_note( self.startup_note ) self.database.next_id( self.scheduler.thread ) self.user = User( ( yield Scheduler.SLEEP ), self.username, self.password, self.email_address, self.notebooks ) @@ -81,11 +87,9 @@ class Test_users( Test_controller ): assert result[ u"user" ].username == self.new_username notebooks = result[ u"notebooks" ] - assert len( notebooks ) == 2 - assert notebooks[ 0 ] == self.anon_notebook - assert notebooks[ 0 ].trash == None + assert len( notebooks ) == 1 - notebook = notebooks[ 1 ] + notebook = notebooks[ 0 ] assert notebook.object_id == new_notebook_id assert notebook.trash assert len( notebook.notes ) == 1 @@ -94,7 +98,7 @@ class Test_users( Test_controller ): startup_notes = result[ "startup_notes" ] if include_startup_notes: assert len( startup_notes ) == 1 - assert startup_notes[ 0 ] == self.startup_note + assert u"welcome to your wiki" in startup_notes[ 0 ].contents else: assert startup_notes == [] @@ -162,7 +166,7 @@ class Test_users( Test_controller ): ) assert result[ u"user" ] == self.user - assert result[ u"notebooks" ] == [ self.anon_notebook ] + self.notebooks + assert result[ u"notebooks" ] == self.notebooks assert result[ u"http_url" ] == self.settings[ u"global" ].get( u"luminotes.http_url" ) startup_notes = result[ "startup_notes" ] @@ -187,7 +191,7 @@ class Test_users( Test_controller ): startup_notes = result[ "startup_notes" ] if include_startup_notes: assert len( startup_notes ) == 1 - assert startup_notes[ 0 ] == self.startup_note + assert startup_notes[ 0 ] == self.anon_startup_note else: assert startup_notes == [] diff --git a/static/js/Wiki.js b/static/js/Wiki.js index ef892a6..08a8bf1 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -62,9 +62,6 @@ Wiki.prototype.display_user = function ( result ) { for ( var i in result.notebooks ) { var notebook = result.notebooks[ i ]; - if ( notebook.name == "Luminotes" ) - continue; - var div_class = "link_area_item"; if ( notebook.object_id == this.notebook_id ) div_class += " current_notebook_name";