mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-11 12:03:00 +00:00
sqlalchemy 2 compatibility
- avoid backref warnings by adding objects to session explicitly before creating any relationships - remove unnecessary `[]` around scalar query - use `text()` wrapper on connection.execute - engine.execute is removed - update import of declarative_base - ensure RemovedIn20Warning is available for warnings filters on sqlalchemy < 1.4 (needs editable install to avoid pytest path mismatch) - explicitly relay password in engine.url to alembic
This commit is contained in:
@@ -416,9 +416,10 @@ class User:
|
||||
yield orm_spawner
|
||||
|
||||
def _new_orm_spawner(self, server_name):
|
||||
"""Creat the low-level orm Spawner object"""
|
||||
orm_spawner = orm.Spawner(user=self.orm_user, name=server_name)
|
||||
"""Create the low-level orm Spawner object"""
|
||||
orm_spawner = orm.Spawner(name=server_name)
|
||||
self.db.add(orm_spawner)
|
||||
orm_spawner.user = self.orm_user
|
||||
self.db.commit()
|
||||
assert server_name in self.orm_spawners
|
||||
return orm_spawner
|
||||
|
Reference in New Issue
Block a user