Merge pull request #1080 from ae-utbm/fix-sas-order

Fix sas order
This commit is contained in:
thomas girod 2025-04-13 01:06:31 +02:00 committed by GitHub
commit 169faec479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,7 +46,9 @@ class AlbumController(ControllerBase):
@paginate(PageNumberPaginationExtra, page_size=50) @paginate(PageNumberPaginationExtra, page_size=50)
def fetch_album(self, filters: Query[AlbumFilterSchema]): def fetch_album(self, filters: Query[AlbumFilterSchema]):
"""General-purpose album search.""" """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( @route.get(
"/autocomplete-search", "/autocomplete-search",
@ -63,7 +65,9 @@ class AlbumController(ControllerBase):
If you don't need the path of the albums, If you don't need the path of the albums,
do NOT use this route. 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") @api_controller("/sas/picture")