mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03:00 +00:00
Switch to existing getpwnam function
To be honest, `getgrouplist`, `getpwnam`, and `getgrnam` should be static methods in LocalAuthenticator
This commit is contained in:
@@ -601,9 +601,8 @@ class LocalAuthenticator(Authenticator):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def system_user_exists(user):
|
def system_user_exists(user):
|
||||||
"""Check if the user exists on the system"""
|
"""Check if the user exists on the system"""
|
||||||
import pwd
|
|
||||||
try:
|
try:
|
||||||
pwd.getpwnam(user.name)
|
getpwnam(user.name)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user