From 054077c99e5b78de549c42f8d52792081c0f72ab Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 28 Mar 2024 14:56:08 +0300 Subject: [PATCH] get_author-follows-debug-3 --- resolvers/author.py | 3 +-- services/cache.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resolvers/author.py b/resolvers/author.py index 3a8f5cc2..7dc7e4d1 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -203,12 +203,11 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0): {'id': 1, 'name': 'Дискурс', 'slug': 'discours', 'pic': ''} ], } - else: - raise ValueError('Author not found') except Exception: import traceback traceback.print_exc() + return {'error': 'Author not found'} @query.field('get_author_follows_topics') diff --git a/services/cache.py b/services/cache.py index 14cafb96..8325e6e9 100644 --- a/services/cache.py +++ b/services/cache.py @@ -106,7 +106,7 @@ async def update_followers_for_author( else: # Remove the entity from followers followers = [e for e in followers if e["id"] != author.id] - await update_author_followers_cache(author.id, followers) + await update_author_followers_cache(author.id.scalar(), followers) return followers