author-follows-result-type-debug
All checks were successful
Deploy on push / deploy (push) Successful in 22s
All checks were successful
Deploy on push / deploy (push) Successful in 22s
This commit is contained in:
parent
72b9bb407d
commit
73c3d47f1b
|
@ -177,7 +177,8 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0):
|
|||
result = local_session().execute(author_query)
|
||||
logger.debug(result)
|
||||
[author] = result
|
||||
if isinstance(author, Author):
|
||||
logger.debug(author)
|
||||
if author and isinstance(author, Author):
|
||||
logger.debug(author.dict())
|
||||
author_id = author.id.scalar()
|
||||
rkey = f'author:{author_id}:follows-authors'
|
||||
|
|
|
@ -114,7 +114,7 @@ def add_author_ratings(q):
|
|||
aliased_author = aliased(Author)
|
||||
selection_list = [
|
||||
aliased_author.id.label("author_id"),
|
||||
func.count().filter(and_(Reaction.created_by == aliased_author.id,Reaction.kind == ReactionKind.COMMENT.value,Reaction.deleted_at.is_(None))).label("comments_count"),
|
||||
func.count().filter(and_(Reaction.created_by == aliased_author.id,Reaction.kind == ReactionKind.COMMENT.value)).label("comments_count"),
|
||||
func.sum(case((AuthorRating.plus == true(), 1), else_=0)).label("likes_count"),
|
||||
func.sum(case((AuthorRating.plus != true(), 1), else_=0)).label("dislikes_count"),
|
||||
func.sum(case((and_(Reaction.kind == ReactionKind.LIKE.value,Shout.authors.any(id=aliased_author.id)),1),else_=0)).label("shouts_likes"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user