Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2024-01-13 21:18:01 +01:00
parent 31619fb5aa
commit f64ce142e4
No known key found for this signature in database
4 changed files with 22 additions and 24 deletions

View File

@ -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:

View File

@ -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:

View File

@ -3265,10 +3265,10 @@
"status": {
"type": "string",
"enum": [
"UNKNOWN",
"SUCCESSFUL",
"WARNING",
"ERROR"
"unknown",
"successful",
"warning",
"error"
],
"title": "Status"
},

View File

@ -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