diff options
author | 2021-03-01 16:56:02 +0300 | |
---|---|---|
committer | 2021-03-01 16:56:02 +0300 | |
commit | da41f255a06516c1b7b85a587b982535cd7fec54 (patch) | |
tree | ef223949e66cf92ffca6e7a66e0c9d3289aa33a8 /backend/authentication/user.py | |
parent | Allows All CORS Requests On Development (diff) |
Make Admin Fetch Async
Signed-off-by: Hassan Abouelela <[email protected]>
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 52baa61..857c2ed 100644 --- a/backend/authentication/user.py +++ b/backend/authentication/user.py @@ -34,8 +34,8 @@ class User(BaseUser): def decoded_token(self) -> dict[str, any]: return jwt.decode(self.token, SECRET_KEY, algorithms=["HS256"]) - def fetch_admin_status(self, request: Request) -> bool: - self.admin = request.state.db.admins.find_one( + async def fetch_admin_status(self, request: Request) -> bool: + self.admin = await request.state.db.admins.find_one( {"_id": self.payload["id"]} ) is not None |