author-get-fix
All checks were successful
Deploy on push / deploy (push) Successful in 24s

This commit is contained in:
Untone 2024-04-09 13:41:30 +03:00
parent 739b7b40d6
commit 6e17b89f26

View File

@ -36,8 +36,8 @@ async def follow(_, info, what, slug):
if what == 'AUTHOR':
error = author_follow(follower.id, slug)
if not error:
author_query = select(Author).where(Author.slug == slug)
[author] = local_session().execute(author_query)
author = local_session().query(Author).where(Author.slug == slug).first()
if author:
await notify_follower(follower.dict(), author.id, 'follow')
elif what == 'TOPIC':
@ -76,8 +76,8 @@ async def unfollow(_, info, what, slug):
# NOTE: after triggers should update cached stats
if not error:
logger.info(f'@{follower.slug} unfollowed @{slug}')
author_query = select(Author).where(Author.slug == slug)
[author] = local_session().execute(author_query)
author = local_session().query(Author).where(Author.slug == slug).first()
if author:
await notify_follower(follower.dict(), author.id, 'unfollow')
elif what == 'TOPIC':