提交 0ebf66b5 编写于 作者: B Bruno Seoane

Fix set config endpoint

上级 99b05add
......@@ -230,14 +230,10 @@ class Api:
return options
def set_config(self, req: OptionsModel):
# currently req has all options fields even if you send a dict like { "send_seed": false }, which means it will
# overwrite all options with default values.
raise RuntimeError('Setting options via API is not supported')
reqDict = vars(req)
for o in reqDict:
setattr(shared.opts, o, reqDict[o])
def set_config(self, req: Dict[str, Any]):
for o in req:
setattr(shared.opts, o, req[o])
shared.opts.save(shared.config_filename)
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册