mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 07:53:00 +00:00
system_user_exists and add_system_user are static methods
This commit is contained in:
@@ -100,7 +100,8 @@ class LocalAuthenticator(Authenticator):
|
||||
|
||||
super(LocalAuthenticator, self).add_user(user)
|
||||
|
||||
def system_user_exists(self, user):
|
||||
@staticmethod
|
||||
def system_user_exists(user):
|
||||
"""Check if the user exists on the system"""
|
||||
try:
|
||||
pwd.getpwnam(user.name)
|
||||
@@ -109,6 +110,7 @@ class LocalAuthenticator(Authenticator):
|
||||
else:
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def add_system_user(user):
|
||||
"""Create a new *ix user on the system. Works on FreeBSD and Linux, at least."""
|
||||
name = user.name
|
||||
|
Reference in New Issue
Block a user