query-fix

This commit is contained in:
Untone 2023-11-29 13:50:20 +03:00
parent 6bac6b737e
commit cdb9d31fa4

View File

@ -380,6 +380,8 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
q = q.where(Reaction.deleted_at.is_(None))
q = q.limit(limit).offset(offset)
reactions = []
with local_session() as session:
result_rows = session.execute(q)
for [
reaction,
author,
@ -387,7 +389,7 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
reacted_stat,
commented_stat,
rating_stat,
] in local_session().execute(q):
] in result_rows:
reaction.created_by = author
reaction.shout = shout
reaction.stat = {