From 6aae4be54da3038027e4b6aad6e2baf43921933f Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 8 Apr 2015 11:06:09 -0700 Subject: [PATCH] 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. --- jupyterhub/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 9fd9d6b7..7cc28399 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -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: