Skip to content
Snippets Groups Projects
Commit f0c48af0 authored by borzechof99's avatar borzechof99 :whale2:
Browse files

Fix Ordering of PK in Sport

parent 329ed332
No related branches found
No related tags found
No related merge requests found
......@@ -77,8 +77,12 @@ class SmallSportListView(viewsets.ViewSet):
if "ordering" in request.query_params.keys():
order_by = order_by_dict[request.query_params.get("ordering")]
if order_by[0] in ["pk", "-pk"]:
# Dont Lower when Ordering by PK
sports = Sport.objects.filter(currently_active=True).order_by(order_by[0])
# Maybe care for is_filled ordering in the Future?
if order_by[1]:
elif order_by[1]:
sports = Sport.objects.filter(currently_active=True).order_by(
Lower(order_by[0]).desc()
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment