Fix IRC config mutation
This commit is contained in:
parent
d0ea3bb221
commit
659162ebc6
|
@ -214,7 +214,6 @@ class API(object):
|
||||||
if net not in main.network.keys():
|
if net not in main.network.keys():
|
||||||
return dumps({"success": False, "reason": "no such net."})
|
return dumps({"success": False, "reason": "no such net."})
|
||||||
nets = [net]
|
nets = [net]
|
||||||
print("NETS", nets)
|
|
||||||
for net_name in nets:
|
for net_name in nets:
|
||||||
conns = helpers.get_connected_relays(net_name)
|
conns = helpers.get_connected_relays(net_name)
|
||||||
if not conns:
|
if not conns:
|
||||||
|
@ -228,14 +227,12 @@ class API(object):
|
||||||
conn.regPing(reset=True)
|
conn.regPing(reset=True)
|
||||||
elif func == "register":
|
elif func == "register":
|
||||||
for conn in conns:
|
for conn in conns:
|
||||||
print("REGISTER ACCOUNT", conn.net, conn.num)
|
|
||||||
regproc.registerAccount(conn.net, conn.num)
|
regproc.registerAccount(conn.net, conn.num)
|
||||||
return dumps({"success": True})
|
return dumps({"success": True})
|
||||||
|
|
||||||
@app.route("/irc/network/<net>/", methods=["POST"])
|
@app.route("/irc/network/<net>/", methods=["POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def irc_network(self, request, net):
|
def irc_network(self, request, net):
|
||||||
print("IRC_NETWORK")
|
|
||||||
if net not in main.network.keys():
|
if net not in main.network.keys():
|
||||||
return dumps({"success": False, "reason": "no such net."})
|
return dumps({"success": False, "reason": "no such net."})
|
||||||
inst = main.network[net]
|
inst = main.network[net]
|
||||||
|
|
|
@ -35,7 +35,7 @@ def selectInst(net):
|
||||||
if i not in inst:
|
if i not in inst:
|
||||||
inst[i] = main.irc["_"][i]
|
inst[i] = main.irc["_"][i]
|
||||||
else:
|
else:
|
||||||
inst = main.irc["_"]
|
inst = deepcopy(main.irc["_"])
|
||||||
return inst
|
return inst
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue