This commit is contained in:
parent
dc791d4e7a
commit
c9205a698f
|
@ -150,7 +150,7 @@ async def load_authors_by(_, _info, by, limit, offset):
|
|||
|
||||
q = q.limit(limit).offset(offset)
|
||||
|
||||
authors_nostat = local_session().session(q)
|
||||
authors_nostat = local_session().execute(q)
|
||||
authors = []
|
||||
if authors_nostat:
|
||||
for [a] in authors_nostat:
|
||||
|
|
|
@ -175,12 +175,14 @@ def prepare_new_rating(reaction: dict, shout_id: int, session, author_id: int):
|
|||
Reaction.shout == shout_id,
|
||||
Reaction.created_by == author_id,
|
||||
Reaction.kind.in_(RATING_REACTIONS),
|
||||
Reaction.deleted_at.is_not(None),
|
||||
)
|
||||
)
|
||||
reply_to = reaction.get("reply_to")
|
||||
if reply_to and isinstance(reply_to, int):
|
||||
q = q.filter(Reaction.reply_to == reply_to)
|
||||
rating_reactions = session.execute(q).all()
|
||||
if rating_reactions:
|
||||
same_rating = filter(
|
||||
lambda r: r.created_by == author_id and r.kind == kind,
|
||||
rating_reactions,
|
||||
|
|
Loading…
Reference in New Issue
Block a user