mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 06:12:53 +08:00
修复webui元祖类型无法正确转换类型
This commit is contained in:
parent
c089388323
commit
a380fcb680
@ -250,6 +250,7 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能
|
||||
### 2022/7/31
|
||||
|
||||
* 对nonebot.beta4中PluginMeta进行解析
|
||||
* 修改webui元祖类型无法正确转换类型
|
||||
* 查看订阅以图片形式发送
|
||||
|
||||
### 2022/7/30
|
||||
|
||||
@ -111,6 +111,9 @@ def _(plugin: Plugin, user: User = Depends(token_to_user)) -> Result:
|
||||
try:
|
||||
if plugin.plugin_config:
|
||||
for c in plugin.plugin_config:
|
||||
if not c.value:
|
||||
Config.set_config(plugin.model, c.key, None)
|
||||
continue
|
||||
if str(c.value).lower() in ["true", "false"] and (
|
||||
c.default_value is None or isinstance(c.default_value, bool)
|
||||
):
|
||||
@ -124,8 +127,8 @@ def _(plugin: Plugin, user: User = Depends(token_to_user)) -> Result:
|
||||
) or isinstance(c.default_value, float):
|
||||
c.value = float(c.value)
|
||||
elif isinstance(c.value, str) and (
|
||||
isinstance(Config.get_config(plugin.model, c.key, c.value), list)
|
||||
or isinstance(c.default_value, list)
|
||||
isinstance(Config.get_config(plugin.model, c.key, c.value), (list, tuple))
|
||||
or isinstance(c.default_value, (list, tuple))
|
||||
):
|
||||
default_value = Config.get_config(plugin.model, c.key, c.value)
|
||||
c.value = c.value.split(",")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user