Skip to content

Commit

Permalink
resolve: change code style
Browse files Browse the repository at this point in the history
  • Loading branch information
rolin999 committed Nov 18, 2024
1 parent 0c30cdf commit b2f5b1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bk-user/bkuser/apis/web/audit/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b2f5b1b

Please sign in to comment.