mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 06:22:59 +00:00
add User.running
as the one true way to check whether a user is running or not User.running will be True if spawn or stop is pending.
This commit is contained in:
@@ -267,6 +267,15 @@ class User(Base):
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def running(self):
|
||||
"""property for whether a user has a running server"""
|
||||
if self.spawner is None:
|
||||
return False
|
||||
if self.server is None:
|
||||
return False
|
||||
return True
|
||||
|
||||
def new_api_token(self):
|
||||
"""Create a new API token"""
|
||||
assert self.id is not None
|
||||
|
Reference in New Issue
Block a user