This commit is contained in:
@@ -114,6 +114,7 @@ def load_authors_by(_, _info, by, limit, offset):
|
||||
if order in ['likes', 'shouts', 'followers']:
|
||||
q = q.order_by(desc(text(f'{order}_stat')))
|
||||
|
||||
q = q.distinct()
|
||||
q = q.limit(limit).offset(offset)
|
||||
|
||||
authors = get_with_stat(q)
|
||||
|
@@ -454,7 +454,9 @@ async def load_shouts_random_top(_, _info, options):
|
||||
limit = options.get('limit', 10)
|
||||
q = q.group_by(Shout.id).order_by(func.random()).limit(limit)
|
||||
|
||||
return await get_shouts_from_query(q)
|
||||
shouts = await get_shouts_from_query(q)
|
||||
|
||||
return shouts
|
||||
|
||||
|
||||
@query.field('load_shouts_random_topic')
|
||||
|
Reference in New Issue
Block a user