From 7907e5bc4fb8f32c96a7164d3cc0cb1e5a8d290e Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 28 Mar 2024 13:37:28 +0300 Subject: [PATCH] get_author_follows-fix --- resolvers/author.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resolvers/author.py b/resolvers/author.py index f73e063e..3ae02aa7 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -173,7 +173,7 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0): raise ValueError('One of slug, user, or author_id must be provided') [author] = local_session().execute(author_query) if isinstance(author, Author): - author_id = author.id + author_id = author.id.scalar() rkey = f'author:{author_id}:follows-authors' logger.debug(f'getting {author_id} follows authors') cached = await redis.execute('GET', rkey) @@ -186,7 +186,7 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0): rkey = f'author:{author_id}:follows-topics' cached = await redis.execute('GET', rkey) - if cached: + if cached and isinstance(cached, str): topics = json.loads(cached) if not cached: topics = author_follows_topics(author_id)