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
|
||||
def system_user_exists(user):
|
||||
"""Check if the user exists on the system"""
|
||||
import pwd
|
||||
try:
|
||||
pwd.getpwnam(user.name)
|
||||
getpwnam(user.name)
|
||||
except KeyError:
|
||||
return False
|
||||
else:
|
||||
|
Reference in New Issue
Block a user