Refactored DB handlers
This commit is contained in:
@@ -24,6 +24,8 @@ def role_required(required_role: UserRoles):
|
||||
# Make a DB call to get the user and their role
|
||||
user = await current_app.user_db_h.find_user({"_id": user_id})
|
||||
|
||||
print("YERERERE", user)
|
||||
|
||||
if not user:
|
||||
abort(401, "User not found or invalid token.") # User corresponding to token not found
|
||||
|
||||
|
||||
Reference in New Issue
Block a user