From f64ce142e42b2958b43fe2684c3df7c52016d204 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 13 Jan 2024 21:18:01 +0100 Subject: [PATCH] fix enum Signed-off-by: Jens Langhammer --- authentik/core/api/used_by.py | 2 +- authentik/events/api/tasks.py | 4 +--- blueprints/schema.json | 8 ++++---- schema.yml | 32 ++++++++++++++++---------------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/authentik/core/api/used_by.py b/authentik/core/api/used_by.py index 25e7d8295..3f7d4fc8a 100644 --- a/authentik/core/api/used_by.py +++ b/authentik/core/api/used_by.py @@ -31,7 +31,7 @@ class UsedBySerializer(PassiveSerializer): model_name = CharField() pk = CharField() name = CharField() - action = ChoiceField(choices=[(x.name, x.name) for x in DeleteAction]) + action = ChoiceField(choices=[(x.value, x.name) for x in DeleteAction]) def get_delete_action(manager: Manager) -> str: diff --git a/authentik/events/api/tasks.py b/authentik/events/api/tasks.py index 8f1f0f153..ca8926b15 100644 --- a/authentik/events/api/tasks.py +++ b/authentik/events/api/tasks.py @@ -36,9 +36,7 @@ class SystemTaskSerializer(ModelSerializer): finish_timestamp = DateTimeField() duration = SerializerMethodField() - status = ChoiceField( - choices=[(x.name, x.name) for x in TaskStatus], - ) + status = ChoiceField(choices=[(x.value, x.name) for x in TaskStatus]) messages = ListField(child=CharField()) def get_full_name(self, instance: SystemTask) -> str: diff --git a/blueprints/schema.json b/blueprints/schema.json index 7322553c5..25f9d226c 100644 --- a/blueprints/schema.json +++ b/blueprints/schema.json @@ -3265,10 +3265,10 @@ "status": { "type": "string", "enum": [ - "UNKNOWN", - "SUCCESSFUL", - "WARNING", - "ERROR" + "unknown", + "successful", + "warning", + "error" ], "title": "Status" }, diff --git a/schema.yml b/schema.yml index 31e2afbe5..729eb6a61 100644 --- a/schema.yml +++ b/schema.yml @@ -42744,16 +42744,16 @@ components: - uuid SystemTaskStatusEnum: enum: - - UNKNOWN - - SUCCESSFUL - - WARNING - - ERROR + - unknown + - successful + - warning + - error type: string description: |- - * `UNKNOWN` - UNKNOWN - * `SUCCESSFUL` - SUCCESSFUL - * `WARNING` - WARNING - * `ERROR` - ERROR + * `unknown` - UNKNOWN + * `successful` - SUCCESSFUL + * `warning` - WARNING + * `error` - ERROR TOTPDevice: type: object description: Serializer for totp authenticator devices @@ -43095,16 +43095,16 @@ components: - pk UsedByActionEnum: enum: - - CASCADE - - CASCADE_MANY - - SET_NULL - - SET_DEFAULT + - cascade + - cascade_many + - set_null + - set_default type: string description: |- - * `CASCADE` - CASCADE - * `CASCADE_MANY` - CASCADE_MANY - * `SET_NULL` - SET_NULL - * `SET_DEFAULT` - SET_DEFAULT + * `cascade` - CASCADE + * `cascade_many` - CASCADE_MANY + * `set_null` - SET_NULL + * `set_default` - SET_DEFAULT User: type: object description: User Serializer