This commit is contained in:
parent
739b7b40d6
commit
6e17b89f26
|
@ -36,9 +36,9 @@ async def follow(_, info, what, slug):
|
||||||
if what == 'AUTHOR':
|
if what == 'AUTHOR':
|
||||||
error = author_follow(follower.id, slug)
|
error = author_follow(follower.id, slug)
|
||||||
if not error:
|
if not error:
|
||||||
author_query = select(Author).where(Author.slug == slug)
|
author = local_session().query(Author).where(Author.slug == slug).first()
|
||||||
[author] = local_session().execute(author_query)
|
if author:
|
||||||
await notify_follower(follower.dict(), author.id, 'follow')
|
await notify_follower(follower.dict(), author.id, 'follow')
|
||||||
|
|
||||||
elif what == 'TOPIC':
|
elif what == 'TOPIC':
|
||||||
error = topic_follow(follower.id, slug)
|
error = topic_follow(follower.id, slug)
|
||||||
|
@ -76,9 +76,9 @@ async def unfollow(_, info, what, slug):
|
||||||
# NOTE: after triggers should update cached stats
|
# NOTE: after triggers should update cached stats
|
||||||
if not error:
|
if not error:
|
||||||
logger.info(f'@{follower.slug} unfollowed @{slug}')
|
logger.info(f'@{follower.slug} unfollowed @{slug}')
|
||||||
author_query = select(Author).where(Author.slug == slug)
|
author = local_session().query(Author).where(Author.slug == slug).first()
|
||||||
[author] = local_session().execute(author_query)
|
if author:
|
||||||
await notify_follower(follower.dict(), author.id, 'unfollow')
|
await notify_follower(follower.dict(), author.id, 'unfollow')
|
||||||
|
|
||||||
elif what == 'TOPIC':
|
elif what == 'TOPIC':
|
||||||
error = topic_unfollow(follower.id, slug)
|
error = topic_unfollow(follower.id, slug)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user