load-random-topic-fix
All checks were successful
deploy / deploy (push) Successful in 1m30s

This commit is contained in:
2023-12-25 01:06:27 +03:00
parent c236768c07
commit 0ea9f45854
4 changed files with 16 additions and 18 deletions

View File

@@ -125,14 +125,14 @@ def count_author_rating(session, author_id) -> int:
shouts_likes = (
session.query(Reaction, Shout)
.join(Shout, Shout.id == Reaction.shout)
.filter(and_(Shout.authors.any(author_id), Reaction.kind == ReactionKind.LIKE.value))
.filter(and_(Shout.authors.any(id=author_id), Reaction.kind == ReactionKind.LIKE.value))
.count()
or 0
)
shouts_dislikes = (
session.query(Reaction, Shout)
.join(Shout, Shout.id == Reaction.shout)
.filter(and_(Shout.authors.any(author_id), Reaction.kind == ReactionKind.DISLIKE.value))
.filter(and_(Shout.authors.any(id=author_id), Reaction.kind == ReactionKind.DISLIKE.value))
.count()
or 0
)