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() model_name = CharField()
pk = CharField() pk = CharField()
name = 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: def get_delete_action(manager: Manager) -> str:

View File

@ -36,9 +36,7 @@ class SystemTaskSerializer(ModelSerializer):
finish_timestamp = DateTimeField() finish_timestamp = DateTimeField()
duration = SerializerMethodField() duration = SerializerMethodField()
status = ChoiceField( status = ChoiceField(choices=[(x.value, x.name) for x in TaskStatus])
choices=[(x.name, x.name) for x in TaskStatus],
)
messages = ListField(child=CharField()) messages = ListField(child=CharField())
def get_full_name(self, instance: SystemTask) -> str: def get_full_name(self, instance: SystemTask) -> str:

View File

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

View File

@ -42744,16 +42744,16 @@ components:
- uuid - uuid
SystemTaskStatusEnum: SystemTaskStatusEnum:
enum: enum:
- UNKNOWN - unknown
- SUCCESSFUL - successful
- WARNING - warning
- ERROR - error
type: string type: string
description: |- description: |-
* `UNKNOWN` - UNKNOWN * `unknown` - UNKNOWN
* `SUCCESSFUL` - SUCCESSFUL * `successful` - SUCCESSFUL
* `WARNING` - WARNING * `warning` - WARNING
* `ERROR` - ERROR * `error` - ERROR
TOTPDevice: TOTPDevice:
type: object type: object
description: Serializer for totp authenticator devices description: Serializer for totp authenticator devices
@ -43095,16 +43095,16 @@ components:
- pk - pk
UsedByActionEnum: UsedByActionEnum:
enum: enum:
- CASCADE - cascade
- CASCADE_MANY - cascade_many
- SET_NULL - set_null
- SET_DEFAULT - set_default
type: string type: string
description: |- description: |-
* `CASCADE` - CASCADE * `cascade` - CASCADE
* `CASCADE_MANY` - CASCADE_MANY * `cascade_many` - CASCADE_MANY
* `SET_NULL` - SET_NULL * `set_null` - SET_NULL
* `SET_DEFAULT` - SET_DEFAULT * `set_default` - SET_DEFAULT
User: User:
type: object type: object
description: User Serializer description: User Serializer