From 2658244671fc22aebdd7571a46e101bd1e14ca9b Mon Sep 17 00:00:00 2001 From: Thomas Girod Date: Sat, 12 Apr 2025 18:09:39 +0200 Subject: [PATCH] fix album ordering on SAS --- sas/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sas/api.py b/sas/api.py index 175e44c0..b82ff5e1 100644 --- a/sas/api.py +++ b/sas/api.py @@ -46,7 +46,9 @@ class AlbumController(ControllerBase): @paginate(PageNumberPaginationExtra, page_size=50) def fetch_album(self, filters: Query[AlbumFilterSchema]): """General-purpose album search.""" - return filters.filter(Album.objects.viewable_by(self.context.request.user)) + return filters.filter( + Album.objects.viewable_by(self.context.request.user).order_by("-date") + ) @route.get( "/autocomplete-search", @@ -63,7 +65,9 @@ class AlbumController(ControllerBase): If you don't need the path of the albums, do NOT use this route. """ - return filters.filter(Album.objects.viewable_by(self.context.request.user)) + return filters.filter( + Album.objects.viewable_by(self.context.request.user).order_by("-date") + ) @api_controller("/sas/picture")