mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
Merge pull request #3773 from IgorBerman/issue-3772-user_options-returns-empty-jupyterhub-restart
Using orm_spawner in server model user_options
This commit is contained in:
@@ -81,6 +81,18 @@ async def test_spawner(db, request):
|
|||||||
assert isinstance(status, int)
|
assert isinstance(status, int)
|
||||||
|
|
||||||
|
|
||||||
|
def test_spawner_from_db(app, user):
|
||||||
|
spawner = user.spawners['name']
|
||||||
|
user_options = {"test": "value"}
|
||||||
|
spawner.orm_spawner.user_options = user_options
|
||||||
|
app.db.commit()
|
||||||
|
# delete and recreate the spawner from the db
|
||||||
|
user.spawners.pop('name')
|
||||||
|
new_spawner = user.spawners['name']
|
||||||
|
assert new_spawner.orm_spawner.user_options == user_options
|
||||||
|
assert new_spawner.user_options == user_options
|
||||||
|
|
||||||
|
|
||||||
async def wait_for_spawner(spawner, timeout=10):
|
async def wait_for_spawner(spawner, timeout=10):
|
||||||
"""Wait for an http server to show up
|
"""Wait for an http server to show up
|
||||||
|
|
||||||
|
@@ -376,6 +376,7 @@ class User:
|
|||||||
oauth_client_id=client_id,
|
oauth_client_id=client_id,
|
||||||
cookie_options=self.settings.get('cookie_options', {}),
|
cookie_options=self.settings.get('cookie_options', {}),
|
||||||
trusted_alt_names=trusted_alt_names,
|
trusted_alt_names=trusted_alt_names,
|
||||||
|
user_options=orm_spawner.user_options or {},
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.settings.get('internal_ssl'):
|
if self.settings.get('internal_ssl'):
|
||||||
|
Reference in New Issue
Block a user