From ff5f5f65e86e994106ac577338974c81125df116 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 3 Mar 2021 21:34:12 +0100 Subject: [PATCH] web: fix date display issue --- authentik/admin/api/tasks.py | 4 ++-- authentik/root/settings.py | 1 + swagger.yaml | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/authentik/admin/api/tasks.py b/authentik/admin/api/tasks.py index d3abd5dea..3dca24bc1 100644 --- a/authentik/admin/api/tasks.py +++ b/authentik/admin/api/tasks.py @@ -25,8 +25,8 @@ class TaskSerializer(Serializer): task_finish_timestamp = DateTimeField(source="finish_timestamp") status = ChoiceField( - source="result.status.name", - choices=[(x.name, x.name) for x in TaskResultStatus], + source="result.status.value", + choices=[(x.value, x.name) for x in TaskResultStatus], ) messages = ListField(source="result.messages") diff --git a/authentik/root/settings.py b/authentik/root/settings.py index 3e1e534f2..abfe9485a 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -150,6 +150,7 @@ SWAGGER_SETTINGS = { REST_FRAMEWORK = { "DEFAULT_PAGINATION_CLASS": "authentik.api.pagination.Pagination", "PAGE_SIZE": 100, + "DATETIME_FORMAT": "%s", "DEFAULT_FILTER_BACKENDS": [ "rest_framework_guardian.filters.ObjectPermissionsFilter", "django_filters.rest_framework.DjangoFilterBackend", diff --git a/swagger.yaml b/swagger.yaml index 25d5741ae..a71fea5e9 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -9332,11 +9332,11 @@ definitions: format: date-time status: title: Status - type: string + type: integer enum: - - SUCCESSFUL - - WARNING - - ERROR + - 1 + - 2 + - 4 messages: description: '' type: array