From 38f0838cf041eef1124bc761f18468aae5581780 Mon Sep 17 00:00:00 2001 From: Francisco Griman Date: Mon, 25 Nov 2024 02:08:51 -0400 Subject: [PATCH] refactor(users_db): remove user_schema instance and use UserSchema directly in get_users --- src/data/services/users_db.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/data/services/users_db.py b/src/data/services/users_db.py index eaed7ad..c43d9d4 100644 --- a/src/data/services/users_db.py +++ b/src/data/services/users_db.py @@ -4,8 +4,6 @@ from ..models import User from ..schemas import UserSchema -user_schema = UserSchema() - def is_user_valid(session: Session, token: str) -> bool: user = session.query(User).filter(User.token == token).first() if not user: @@ -31,4 +29,4 @@ def delete_user(session: Session, id: int) -> None: def get_users(session: Session) -> list: models = session.query(User).all() - return user_schema.dump(models, many=True) \ No newline at end of file + return UserSchema().dump(models, many=True) \ No newline at end of file