groupby-fix
All checks were successful
Deploy on push / deploy (push) Successful in 25s

This commit is contained in:
Untone 2024-02-28 19:14:57 +03:00
parent 6c0b43bd14
commit b99ed1a7d1

View File

@ -478,7 +478,7 @@ async def load_shouts_random_topic(_, info, limit: int = 10):
aliased_reaction = aliased(Reaction)
q = add_reaction_stat_columns(q, aliased_reaction)
q = q.group_by(Shout.id).order_by(desc(Shout.created_at)).limit(limit)
q = q.group_by(Shout.id, Topic.slug).order_by(desc(Shout.created_at)).limit(limit)
result = local_session().execute(q)
if result: