Fix set config endpoint
This commit is contained in:
parent
99b05addb1
commit
0ebf66b575
|
@ -230,14 +230,10 @@ class Api:
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
def set_config(self, req: OptionsModel):
|
def set_config(self, req: Dict[str, Any]):
|
||||||
# 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.
|
for o in req:
|
||||||
raise RuntimeError('Setting options via API is not supported')
|
setattr(shared.opts, o, req[o])
|
||||||
|
|
||||||
reqDict = vars(req)
|
|
||||||
for o in reqDict:
|
|
||||||
setattr(shared.opts, o, reqDict[o])
|
|
||||||
|
|
||||||
shared.opts.save(shared.config_filename)
|
shared.opts.save(shared.config_filename)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue