From acc68147dc889a4de816326b3c80b98c66bed52f Mon Sep 17 00:00:00 2001 From: Matthew Mincher Date: Sun, 21 Jul 2024 12:39:05 +0100 Subject: [PATCH] Order user shelf previews by book shelved date --- bookwyrm/views/user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/views/user.py b/bookwyrm/views/user.py index ba224d671..2de60a23f 100644 --- a/bookwyrm/views/user.py +++ b/bookwyrm/views/user.py @@ -55,7 +55,9 @@ class User(View): { "name": user_shelf.name, "local_path": user_shelf.local_path, - "books": user_shelf.books.all()[:3], + "books": user_shelf.books.order_by( + "-shelfbook__shelved_date" + ).all()[:3], "size": user_shelf.books.count(), } )