From bb01b716e03a4e38b1b8e7fd25317249b843f311 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 18 Nov 2014 15:35:37 -0800 Subject: [PATCH] allow login_handler to be undefined (for use outside IPython) --- IPython/html/base/handlers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IPython/html/base/handlers.py b/IPython/html/base/handlers.py index cf9869149..882c0a428 100644 --- a/IPython/html/base/handlers.py +++ b/IPython/html/base/handlers.py @@ -95,7 +95,7 @@ class AuthenticatedHandler(web.RequestHandler): @property def login_handler(self): """Return the login handler for this application.""" - return self.settings['login_handler_class'] + return self.settings.get('login_handler_class', None) @property def login_available(self): @@ -105,6 +105,8 @@ class AuthenticatedHandler(web.RequestHandler): whether the user is already logged in or not. """ + if self.login_handler is None: + return False return bool(self.login_handler.login_available(self.settings))