mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
chore: enhance tool query to include user nickname
--bug=1061299 --user=刘瑞斌 【工具】编辑工具后,工具的创建者不显示了,刷新可恢复正常 https://www.tapd.cn/62980211/s/1766692
This commit is contained in:
parent
fcd6b53bfc
commit
d5d962c53d
|
|
@ -515,7 +515,8 @@ class ToolSerializer(serializers.Serializer):
|
|||
|
||||
def one(self):
|
||||
self.is_one_valid(raise_exception=True)
|
||||
tool = QuerySet(Tool).filter(id=self.data.get('id')).first()
|
||||
tool = QuerySet(Tool).filter(id=self.data.get('id')).select_related('user').first()
|
||||
nick_name = tool.user.nick_name if tool and tool.user else None
|
||||
if tool.init_params:
|
||||
tool.init_params = json.loads(rsa_long_decrypt(tool.init_params))
|
||||
if tool.init_field_list:
|
||||
|
|
@ -528,6 +529,7 @@ class ToolSerializer(serializers.Serializer):
|
|||
return {
|
||||
**ToolModelSerializer(tool).data,
|
||||
'init_params': tool.init_params if tool.init_params else {},
|
||||
'nick_name': nick_name
|
||||
}
|
||||
|
||||
def export(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue