Skip to content

Commit 771346c

Browse files
committed
Plugin model check
1 parent 4500dd0 commit 771346c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/plugin/tools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def get_plugin_models() -> list[type]:
6565
for plugin in get_plugins():
6666
# 导入插件的模型模块
6767
module_path = f'backend.plugin.{plugin}.model'
68+
69+
module_file = os.path.join(PLUGIN_DIR, plugin, "model.py")
70+
if not os.path.exists(module_file): # 先检查文件是否存在
71+
continue
72+
6873
module = import_module_cached(module_path)
6974

7075
# 获取模块中的所有类

0 commit comments

Comments
 (0)