Update views.py

This commit is contained in:
shamoon 2025-02-20 12:11:55 -08:00
parent 31e71aab83
commit 9fe611a24c
No known key found for this signature in database

View File

@ -2233,7 +2233,7 @@ class TasksViewSet(ReadOnlyModelViewSet):
filterset_class = PaperlessTaskFilterSet
def get_queryset(self):
queryset = PaperlessTask.objects.all().order_by("date_created").reverse()
queryset = PaperlessTask.objects.all().order_by("-date_created")
task_id = self.request.query_params.get("task_id")
if task_id is not None:
queryset = PaperlessTask.objects.filter(task_id=task_id)