Skip to content

Commit

Permalink
fix deleted info (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev-semyon authored Aug 26, 2023
1 parent a61120e commit 08a6018
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion userdata_api/utils/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ async def get_user_info(user_id: int, user: dict[str, int | list[dict[str, str |
:param user: Сессия выполняющего запрос данных
:return: Список словарей содержащих категорию, параметр категории и значение этого параметра у польщователя
"""
infos: list[Info] = Info.query(session=db.session).filter(Info.owner_id == user_id).all()
infos: list[Info] = (
Info.query(session=db.session)
.join(Param)
.join(Category)
.filter(Info.owner_id == user_id, not_(Param.is_deleted), not_(Category.is_deleted))
.all()
)
if not infos:
raise ObjectNotFound(Info, user_id)
scope_names = [scope["name"] for scope in user["session_scopes"]]
Expand Down

0 comments on commit 08a6018

Please sign in to comment.