Commit 0ebf66b5 authored by Bruno Seoane's avatar Bruno Seoane
Browse files

Fix set config endpoint

parent 99b05add
Loading
Loading
Loading
Loading
+4 −8
Original line number Original line Diff line number Diff line
@@ -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.
        raise RuntimeError('Setting options via API is not supported')
       
       
        reqDict = vars(req)
        for o in req:
        for o in reqDict:
            setattr(shared.opts, o, req[o])
            setattr(shared.opts, o, reqDict[o])


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