mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03:00 +00:00
Fixed to cope with a None handler passed in tests
This commit is contained in:
@@ -236,7 +236,10 @@ class PAMAuthenticator(LocalAuthenticator):
|
||||
try:
|
||||
pamela.authenticate(username, data['password'], service=self.service)
|
||||
except pamela.PAMError as e:
|
||||
self.log.warn("PAM Authentication failed (@%s): %s", handler.request.remote_ip, e)
|
||||
if handler is not None:
|
||||
self.log.warn("PAM Authentication failed (@%s): %s", handler.request.remote_ip, e)
|
||||
else:
|
||||
self.log.warn("PAM Authentication failed: %s", e)
|
||||
else:
|
||||
return username
|
||||
|
||||
|
Reference in New Issue
Block a user