Remove handling of jupyterhub 0.8

These only affected servers upgrading directly from 0.8 or earlier with still-running servers

0.8 was a long time ago, it's okay to require restarting servers for an upgrade that long
This commit is contained in:
Min RK
2021-04-19 16:55:36 +02:00
parent 639523a27c
commit 3b9e5b1cfe
2 changed files with 2 additions and 12 deletions

View File

@@ -804,14 +804,8 @@ class User:
if orm_token:
self.db.delete(orm_token)
# remove oauth client as well
# handle upgrades from 0.8, where client id will be `user-USERNAME`,
# not just `jupyterhub-user-USERNAME`
client_ids = (
spawner.oauth_client_id,
spawner.oauth_client_id.split('-', 1)[1],
)
for oauth_client in self.db.query(orm.OAuthClient).filter(
orm.OAuthClient.identifier.in_(client_ids)
for oauth_client in self.db.query(orm.OAuthClient).filter_by(
identifier=spawner.oauth_client_id,
):
self.log.debug("Deleting oauth client %s", oauth_client.identifier)
self.db.delete(oauth_client)