Slightly adjust the security level of try fix

https://github.com/ltdrdata/ComfyUI-Manager/issues/1049
This commit is contained in:
Dr.Lt.Data
2024-10-16 08:31:35 +09:00
parent b139bfabf0
commit e8bb7ccda7
3 changed files with 7 additions and 3 deletions

View File

@@ -850,7 +850,7 @@ async def install_custom_node(request):
@PromptServer.instance.routes.post("/customnode/fix")
async def fix_custom_node(request):
if not is_allowed_security_level('high'):
if not is_allowed_security_level('middle'):
print(SECURITY_MESSAGE_GENERAL)
return web.Response(status=403)
@@ -871,6 +871,10 @@ async def fix_custom_node(request):
return web.Response(status=400)
if 'pip' in json_data:
if not is_allowed_security_level('high'):
print(SECURITY_MESSAGE_GENERAL)
return web.Response(status=403)
for pname in json_data['pip']:
install_cmd = [sys.executable, "-m", "pip", "install", '-U', pname]
core.try_install_script(json_data['files'][0], ".", install_cmd)