Skip to content

Commit 0ebf66b

Browse files
committed
Fix set config endpoint
1 parent 99b05ad commit 0ebf66b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

modules/api/api.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,10 @@ def get_config(self):
230230

231231
return options
232232

233-
def set_config(self, req: OptionsModel):
234-
# currently req has all options fields even if you send a dict like { "send_seed": false }, which means it will
235-
# overwrite all options with default values.
236-
raise RuntimeError('Setting options via API is not supported')
237-
238-
reqDict = vars(req)
239-
for o in reqDict:
240-
setattr(shared.opts, o, reqDict[o])
233+
def set_config(self, req: Dict[str, Any]):
234+
235+
for o in req:
236+
setattr(shared.opts, o, req[o])
241237

242238
shared.opts.save(shared.config_filename)
243239
return

0 commit comments

Comments
 (0)