diff --git a/src/meta/bot.py b/src/meta/bot.py index 3d81de7..bf8266b 100644 --- a/src/meta/bot.py +++ b/src/meta/bot.py @@ -178,17 +178,15 @@ class Bot(commands.Bot): # Save the token and scopes to data # Wrap this in a transaction so if it fails halfway we rollback correctly - async with self.dbconn.connection() as conn: - self.dbconn.conn = conn - async with conn.transaction(): - row = await UserAuth.fetch_or_create(userid, token=token, refresh_token=refresh) - if row.token != token or row.refresh_token != refresh: - await row.update(token=token, refresh_token=refresh) - await self.data.user_auth_scopes.delete_where(userid=userid) - await self.data.user_auth_scopes.insert_many( - ('userid', 'scope'), - *((userid, scope) for scope in new_scopes) - ) + # TODO + row = await UserAuth.fetch_or_create(userid, token=token, refresh_token=refresh) + if row.token != token or row.refresh_token != refresh: + await row.update(token=token, refresh_token=refresh) + await self.data.user_auth_scopes.delete_where(userid=userid) + await self.data.user_auth_scopes.insert_many( + ('userid', 'scope'), + *((userid, scope) for scope in new_scopes) + ) logger.info("Updated auth token for user '%s' with scopes: %s", resp.user_id, ', '.join(new_scopes)) return resp diff --git a/src/modules/profiles b/src/modules/profiles index 4653689..ce46bd4 160000 --- a/src/modules/profiles +++ b/src/modules/profiles @@ -1 +1 @@ -Subproject commit 4653689e5e9a096e657f068575443b1dc4d599c3 +Subproject commit ce46bd49fee27b65a67ffaead0151b0a21bcaa0f diff --git a/src/modules/subathon b/src/modules/subathon index 18f57d1..2c8bc4a 160000 --- a/src/modules/subathon +++ b/src/modules/subathon @@ -1 +1 @@ -Subproject commit 18f57d180042e790376b9f80deaa07c86361b5f2 +Subproject commit 2c8bc4ae247fe033236ce00d09619da6aa638042