No longer force a redirect when pending, simply set url to allow users access to home page during a pending spawn

This commit is contained in:
Derek Heldt-Werle
2017-11-21 10:17:42 -08:00
parent 7f7cd0a314
commit ad704d9925

View File

@@ -68,15 +68,10 @@ class HomeHandler(BaseHandler):
# trigger poll_and_notify event in case of a server that died
yield user.spawner.poll_and_notify()
# send user to /hub/user/:name if spawner is pending
if user.spawner.pending:
url = url_path_join(self.hub.base_url, user.url)
self.redirect(url)
return
# send the user to /spawn if they aren't running,
# send the user to /spawn if they aren't running or pending a spawn,
# to establish that this is an explicit spawn request rather
# than an implicit one, which can be caused by any link to `/user/:name`
url = user.url if user.running else url_path_join(self.hub.base_url, 'spawn')
url = user.url if user.running or user.spawner.pending else url_path_join(self.hub.base_url, 'spawn')
html = self.render_template('home.html',
user=user,
url=url,