def testAppSetup( self ): self.assert_( Setting.is_app_setup() == False ) self.assert_( Application.has_been_setup() == False ) Setting( app_name = 'Foobar', app_version = 0.01, allow_registration = True ).put() self.assert_( Setting.is_app_setup() == True ) self.assert_( Application.has_been_setup() == True )
def testAppSetup( self ): # Setting.all().get().delete() self.assert_( Setting.is_app_setup() == False ) Setting( app_name = 'Foobar', app_version = 0.01, allow_registration = True ).put() self.assert_( Setting.is_app_setup() == True )
def post( self ): req = self.request title = req.get( 'title' ) theme = req.get( 'theme' ) if not title or not theme: self.get() return Setting.save( { "title": title, "theme": theme } ) if not Setting.is_app_setup(): self.get() return else: self.redirect( '/admin/dashboard', { } ) return