From f0ef2eea4f69299875c64c01f39ab5616dad031d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 5 Apr 2021 19:20:26 +0200 Subject: [PATCH] admin: sort tasks api Signed-off-by: Jens Langhammer --- authentik/admin/api/tasks.py | 3 ++- web/src/pages/system-tasks/SystemTaskListPage.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/admin/api/tasks.py b/authentik/admin/api/tasks.py index 55c9e1807..08d2e91a4 100644 --- a/authentik/admin/api/tasks.py +++ b/authentik/admin/api/tasks.py @@ -38,7 +38,8 @@ class TaskViewSet(ViewSet): @swagger_auto_schema(responses={200: TaskSerializer(many=True)}) def list(self, request: Request) -> Response: """List current messages and pass into Serializer""" - return Response(TaskSerializer(TaskInfo.all().values(), many=True).data) + tasks = sorted(TaskInfo.all().values(), key=lambda task: task.task_name) + return Response(TaskSerializer(tasks, many=True).data) @action(detail=True, methods=["post"]) # pylint: disable=invalid-name diff --git a/web/src/pages/system-tasks/SystemTaskListPage.ts b/web/src/pages/system-tasks/SystemTaskListPage.ts index c4189c4b7..ffc7ba861 100644 --- a/web/src/pages/system-tasks/SystemTaskListPage.ts +++ b/web/src/pages/system-tasks/SystemTaskListPage.ts @@ -51,7 +51,7 @@ export class SystemTaskListPage extends TablePage { columns(): TableColumn[] { return [ - new TableColumn(t`Identifier`, "task_name"), + new TableColumn(t`Identifier`), new TableColumn(t`Description`), new TableColumn(t`Last run`), new TableColumn(t`Status`),