result-fix3
All checks were successful
Deploy on push / deploy (push) Successful in 25s

This commit is contained in:
Untone 2024-05-21 04:25:40 +03:00
parent 95b2b97dd4
commit a3514e6874

View File

@ -254,8 +254,8 @@ def create_author(user_id: str, slug: str, name: str = ""):
async def get_author_followers(_, _info, slug: str): async def get_author_followers(_, _info, slug: str):
logger.debug(f"getting followers for @{slug}") logger.debug(f"getting followers for @{slug}")
author_query = select(Author.id).filter(Author.slug == slug) author_query = select(Author.id).filter(Author.slug == slug)
author_id_result = local_session().execute(author_query).scalar() author_id = local_session().execute(author_query).scalar()
if author_id_result: followers = []
author_id = author_id_result[0] if author_id_result else None if author_id:
followers = await get_cached_author_followers(author_id) followers = await get_cached_author_followers(author_id)
return followers return followers