diff options
author | 2024-07-17 12:10:25 +0100 | |
---|---|---|
committer | 2024-07-17 22:16:19 +0100 | |
commit | 46af39a2a3286401f87a92b3f488bd8b67184c05 (patch) | |
tree | 9fda172c7f8f30795866659d29e14ba74465b31e /backend/authentication/user.py | |
parent | Simplify the logic for fetching from member cache (diff) |
Use redis to store the role cache
Diffstat (limited to 'backend/authentication/user.py')
-rw-r--r-- | backend/authentication/user.py | 4 |
1 files changed, 2 insertions, 2 deletions
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: |