From ae37f4d951e49ccae7506cf5f177d883a0ca3140 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 30 Jan 2009 16:04:30 -0800 Subject: [PATCH] Fixed a bug in which "/guide" and "/privacy" URLs resulted in errors when logged in as a demo user. --- controller/Root.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controller/Root.py b/controller/Root.py index 17fb080..a4acf30 100644 --- a/controller/Root.py +++ b/controller/Root.py @@ -272,7 +272,8 @@ class Root( object ): @raise Validation_error: one of the arguments is invalid """ result = self.__users.current( user_id ) - guide_notebooks = [ nb for nb in result[ "notebooks" ] if nb.name == u"Luminotes user guide" ] + anon_result = self.__users.current( None ) + guide_notebooks = [ nb for nb in anon_result[ "notebooks" ] if nb.name == u"Luminotes user guide" ] result.update( self.__notebooks.contents( guide_notebooks[ 0 ].object_id, user_id = user_id ) ) @@ -297,7 +298,8 @@ class Root( object ): @raise Validation_error: one of the arguments is invalid """ result = self.__users.current( user_id ) - privacy_notebooks = [ nb for nb in result[ "notebooks" ] if nb.name == u"Luminotes privacy policy" ] + anon_result = self.__users.current( None ) + privacy_notebooks = [ nb for nb in anon_result[ "notebooks" ] if nb.name == u"Luminotes privacy policy" ] result.update( self.__notebooks.contents( privacy_notebooks[ 0 ].object_id, user_id = user_id ) )