From 9b174d94c696979fdd9b80da8372ad25fddea3ca Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 14 Feb 2024 10:51:43 +0300 Subject: [PATCH] postprocess-query-for-order-2 --- resolvers/author.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resolvers/author.py b/resolvers/author.py index b77900de..0419220a 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -227,7 +227,7 @@ async def load_authors_by(_, _info, by, limit, offset): authors = await get_authors_from_query(q) order = by.get('order') if order: - authors = sorted(authors, key=lambda a: a['stat'].get(order, 0), reverse=True) + authors = sorted(authors, key=lambda a: a.stat.get(order, 0), reverse=True) return authors