Skip to content

Commit 08a6018

Browse files
fix deleted info (#16)
1 parent a61120e commit 08a6018

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

userdata_api/utils/user.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ async def get_user_info(user_id: int, user: dict[str, int | list[dict[str, str |
102102
:param user: Сессия выполняющего запрос данных
103103
:return: Список словарей содержащих категорию, параметр категории и значение этого параметра у польщователя
104104
"""
105-
infos: list[Info] = Info.query(session=db.session).filter(Info.owner_id == user_id).all()
105+
infos: list[Info] = (
106+
Info.query(session=db.session)
107+
.join(Param)
108+
.join(Category)
109+
.filter(Info.owner_id == user_id, not_(Param.is_deleted), not_(Category.is_deleted))
110+
.all()
111+
)
106112
if not infos:
107113
raise ObjectNotFound(Info, user_id)
108114
scope_names = [scope["name"] for scope in user["session_scopes"]]

0 commit comments

Comments
 (0)