From b2f5b1b72b6cf9e3b11772ff4a471bdb9e274539 Mon Sep 17 00:00:00 2001 From: rolinchen Date: Mon, 18 Nov 2024 14:44:18 +0800 Subject: [PATCH] resolve: change code style --- src/bk-user/bkuser/apis/web/audit/serializers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bk-user/bkuser/apis/web/audit/serializers.py b/src/bk-user/bkuser/apis/web/audit/serializers.py index b4f150177..c87e26ff4 100644 --- a/src/bk-user/bkuser/apis/web/audit/serializers.py +++ b/src/bk-user/bkuser/apis/web/audit/serializers.py @@ -23,21 +23,21 @@ class AuditRecordListInputSLZ(serializers.Serializer): - creator = serializers.CharField(help_text="操作人", required=False, allow_blank=True) - created_at = serializers.DateTimeField(help_text="操作时间", required=False) operation = serializers.ChoiceField(help_text="操作行为", choices=OperationEnum.get_choices(), required=False) object_type = serializers.ChoiceField( help_text="操作对象类型", choices=ObjectTypeEnum.get_choices(), required=False ) object_name = serializers.CharField(help_text="操作对象名称", required=False, allow_blank=True) + creator = serializers.CharField(help_text="操作人", required=False, allow_blank=True) + created_at = serializers.DateTimeField(help_text="操作时间", required=False) class AuditRecordListOutputSLZ(serializers.Serializer): - creator = serializers.SerializerMethodField(help_text="操作人") - created_at = serializers.DateTimeField(help_text="操作时间") operation = serializers.CharField(help_text="操作行为") object_type = serializers.CharField(help_text="操作对象类型") object_name = serializers.CharField(help_text="操作对象名称", allow_blank=True, allow_null=True) + creator = serializers.SerializerMethodField(help_text="操作人") + created_at = serializers.DateTimeField(help_text="操作时间") def get_creator(self, obj: OperationAuditRecord) -> str: return self.context["user_display_name_map"].get(obj.creator) or obj.creator