use find_user in POST /spawn/:user

so we get a 404 for missing users
This commit is contained in:
Min RK
2018-02-28 11:36:15 +01:00
parent b8d2271191
commit b2527984bc

View File

@@ -139,7 +139,9 @@ class SpawnHandler(BaseHandler):
if for_user is not None and for_user != user.name:
if not user.admin:
raise web.HTTPError(403, "Only admins can spawn on behalf of other users")
user = self.user_from_username(for_user)
user = self.find_user(for_user)
if user is None:
raise web.HTTPError(404, "No such user: %s" % for_user)
if not self.allow_named_servers and user.running:
url = user.url
self.log.warning("User is already running: %s", url)