From d9abea9840fdd0faf83d0dadd7336ab8a6cf8871 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 22 Feb 2024 13:07:09 +0300 Subject: [PATCH] get-user-followsx --- resolvers/follower.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resolvers/follower.py b/resolvers/follower.py index 9b299480..cbb6626c 100644 --- a/resolvers/follower.py +++ b/resolvers/follower.py @@ -86,11 +86,12 @@ async def unfollow(_, info, what, slug): def query_follows(user_id: str): topics = [] authors = [] + author_id = None with local_session() as session: - author_id = ( - session.query(Author.id).filter(Author.user == user_id).first() + author = ( + session.query(Author).filter(Author.user == user_id).first() ) - session.commit() + author_id = author.id if isinstance(author_id, int): authors_query = ( select(Author) @@ -99,7 +100,7 @@ def query_follows(user_id: str): ) authors = [ { - 'id': author.id, + 'id': author_id, 'name': author.name, 'slug': author.slug, 'pic': author.pic,