all authors and some logs

This commit is contained in:
2022-11-17 09:25:26 +03:00
parent 43cf5ea361
commit d62342880b
4 changed files with 17 additions and 13 deletions

View File

@@ -206,9 +206,10 @@ async def load_authors_by(_, info, by, limit, offset):
).order_by(
by.get("order") or "createdAt"
).limit(limit).offset(offset)
print(aq)
authors = list(map(lambda r: r.User, session.execute(aq)))
if by.get("stat"):
for a in authors:
a.stat = await get_author_stat(a.slug)
authors = list(set(authors)).sort(lambda a: a["stat"].get(by.get("stat")))
authors = list(set(authors)).sort(authors, key=lambda a: a["stat"].get(by.get("stat")))
return authors