mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 14:33:00 +00:00
improve condition when failing api request, check if user exists, afterwards check if user is not active
This commit is contained in:
@@ -1098,7 +1098,7 @@ class UserSpawnHandler(BaseHandler):
|
||||
# otherwise redirect users to their own server
|
||||
should_spawn = (current_user and current_user.name == user_name)
|
||||
|
||||
if "api" in user_path.split("/") and not user.active:
|
||||
if "api" in user_path.split("/") and user and not user.active:
|
||||
# API request for not-running server (e.g. notebook UI left open)
|
||||
# Avoid triggering a spawn.
|
||||
self._fail_api_request(user)
|
||||
|
Reference in New Issue
Block a user