From d7e94775722305be6fd18b25fd41edbacf2200de Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 13 Oct 2023 23:32:54 +0200 Subject: [PATCH] get all users in database --- app/routers/users.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/routers/users.py b/app/routers/users.py index 6d722c5..9f5c13b 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -10,8 +10,9 @@ router = APIRouter() async def read_users(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))]): listUsers = [] user_repository = users.UserRepository(database=database.database) - for fake in users_active.fake_users: - user = users.UserOut(id=fake["id"], username=fake["username"], disabled=fake["disabled"], roles=fake["roles"]) + for fake in user_repository.find_by({}): + print(fake) + user = users.UserOut(id=fake.id, username=fake.username, disabled=fake.disabled, roles=fake.roles) listUsers.append(user) return listUsers