add /spawn/:user for spawning servers for a specific user

part of admin-access
This commit is contained in:
Min RK
2018-02-28 11:20:11 +01:00
parent b8978b0235
commit b8d2271191
2 changed files with 22 additions and 4 deletions

View File

@@ -885,7 +885,11 @@ class UserSpawnHandler(BaseHandler):
# server is not running, trigger spawn
if status is not None:
if spawner.options_form:
self.redirect(url_concat(url_path_join(self.hub.base_url, 'spawn'),
url_parts = [self.hub.base_url, 'spawn']
if current_user.name != user.name:
# spawning on behalf of another user
url_parts.append(user.name)
self.redirect(url_concat(url_path_join(*url_parts),
{'next': self.request.uri}))
return
else: