From 46af39a2a3286401f87a92b3f488bd8b67184c05 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 17 Jul 2024 12:10:25 +0100 Subject: Use redis to store the role cache --- backend/authentication/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/authentication/user.py') diff --git a/backend/authentication/user.py b/backend/authentication/user.py index ad59103..5e99546 100644 --- a/backend/authentication/user.py +++ b/backend/authentication/user.py @@ -44,12 +44,12 @@ class User(BaseUser): def decoded_token(self) -> dict[str, any]: return jwt.decode(self.token, SECRET_KEY, algorithms=["HS256"]) - async def get_user_roles(self, database: Database) -> list[str]: + async def get_user_roles(self) -> list[str]: """Get a list of the user's discord roles.""" if not self.member: return [] - server_roles = await discord.get_roles(database) + server_roles = await discord.get_roles() roles = [role.name for role in server_roles if role.id in self.member.roles] if "admin" in roles: -- cgit v1.2.3