From 7dae3e60bf9543455568f2016a3c4fd06c48275e Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Thu, 17 Nov 2022 11:11:30 +0300 Subject: [PATCH] fix-authors-sort --- resolvers/profile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resolvers/profile.py b/resolvers/profile.py index fbd3aed2..4c9ba04a 100644 --- a/resolvers/profile.py +++ b/resolvers/profile.py @@ -211,5 +211,6 @@ async def load_authors_by(_, info, by, limit, offset): if by.get("stat"): for a in authors: a.stat = await get_author_stat(a.slug) - authors = list(set(authors)).sort(authors, key=lambda a: a["stat"].get(by.get("stat"))) + authors = list(set(authors)) + authors = sorted(authors, key=lambda a: a["stat"].get(by.get("stat"))) return authors