updating list view

This commit is contained in:
Zach Flanders 2023-04-25 00:20:54 -05:00
parent 21d9cb5fe5
commit a3013c6224

View file

@ -129,7 +129,7 @@ def sort_list(request, items):
"""helper to handle the surprisingly involved sorting"""
# sort_by shall be "order" unless a valid alternative is given
sort_by = request.GET.get("sort_by", "order")
if sort_by not in ("order", "title", "rating"):
if sort_by not in ("order", "sort_title", "rating"):
sort_by = "order"
# direction shall be "ascending" unless a valid alternative is given
@ -139,7 +139,7 @@ def sort_list(request, items):
directional_sort_by = {
"order": "order",
"title": "book__title",
"sort_title": "book__sort_title",
"rating": "average_rating",
}[sort_by]
if direction == "descending":