From 1276d199e37328f22712af46c27db65ceedcb5d3 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 16 Jul 2024 19:03:49 +0100 Subject: Use redis for the discord member cache over mongo --- backend/authentication/backend.py | 2 +- backend/authentication/user.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'backend/authentication') diff --git a/backend/authentication/backend.py b/backend/authentication/backend.py index 2512761..c84ba10 100644 --- a/backend/authentication/backend.py +++ b/backend/authentication/backend.py @@ -63,7 +63,7 @@ class JWTAuthenticationBackend(authentication.AuthenticationBackend): user = User( token, user_details, - await discord.get_member(request.state.db, user_details["id"]), + await discord.get_member(user_details["id"]), ) if await user.fetch_admin_status(request.state.db): scopes.append("admin") diff --git a/backend/authentication/user.py b/backend/authentication/user.py index c81b7a9..ad59103 100644 --- a/backend/authentication/user.py +++ b/backend/authentication/user.py @@ -67,9 +67,9 @@ class User(BaseUser): return self.admin - async def refresh_data(self, database: Database) -> None: + async def refresh_data(self) -> None: """Fetches user data from discord, and updates the instance.""" - self.member = await discord.get_member(database, self.payload["id"]) + self.member = await discord.get_member(self.payload["id"]) if self.member: self.payload = self.member.user.dict() -- cgit v1.2.3