From 659162ebc6c95623bf03bbfc0f81c5a4118aa7f1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 18 Aug 2022 07:20:30 +0100 Subject: [PATCH] Fix IRC config mutation --- api/views.py | 3 --- modules/regproc.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/api/views.py b/api/views.py index 5b409ab..a8d44ce 100644 --- a/api/views.py +++ b/api/views.py @@ -214,7 +214,6 @@ class API(object): if net not in main.network.keys(): return dumps({"success": False, "reason": "no such net."}) nets = [net] - print("NETS", nets) for net_name in nets: conns = helpers.get_connected_relays(net_name) if not conns: @@ -228,14 +227,12 @@ class API(object): conn.regPing(reset=True) elif func == "register": for conn in conns: - print("REGISTER ACCOUNT", conn.net, conn.num) regproc.registerAccount(conn.net, conn.num) return dumps({"success": True}) @app.route("/irc/network//", methods=["POST"]) @login_required def irc_network(self, request, net): - print("IRC_NETWORK") if net not in main.network.keys(): return dumps({"success": False, "reason": "no such net."}) inst = main.network[net] diff --git a/modules/regproc.py b/modules/regproc.py index 8a35461..5183f1b 100644 --- a/modules/regproc.py +++ b/modules/regproc.py @@ -35,7 +35,7 @@ def selectInst(net): if i not in inst: inst[i] = main.irc["_"][i] else: - inst = main.irc["_"] + inst = deepcopy(main.irc["_"]) return inst