assign hub in token app

avoids AttributeError on hub if there are
users with running servers.

Don't call init_hub,
which can modify the Hub's entries in the database,
which shouldn't happen in the token command.
This commit is contained in:
Min RK
2015-04-08 11:06:09 -07:00
parent 7ed9c9b6c0
commit 6aae4be54d

View File

@@ -126,6 +126,7 @@ class NewToken(Application):
hub = JupyterHub(parent=self)
hub.load_config_file(hub.config_file)
hub.init_db()
hub.hub = hub.db.query(orm.Hub).first()
hub.init_users()
user = orm.User.find(hub.db, self.name)
if user is None: