From 83efd286873135bb4c09cc3021fcd4bf92e09c88 Mon Sep 17 00:00:00 2001 From: bobbyvish Date: Fri, 12 Jul 2024 16:00:55 +0530 Subject: [PATCH] fix(module_2_filter):fixed order by latest --- manage_events/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manage_events/api/views.py b/manage_events/api/views.py index 84543d7..4d4be00 100644 --- a/manage_events/api/views.py +++ b/manage_events/api/views.py @@ -1010,7 +1010,7 @@ class EventListView(generics.ListAPIView): # Replace 'latest' with '-created_on' in the ordering fields ordering = ",".join( - "-start_date" if field == "latest" else f"-{field}" + "start_date" if field == "latest" else f"-{field}" for field in ordering_fields ) # Apply the ordering to the queryset