From f3f717e693ea2ed5893a44480f6bc8086e88f846 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 1 Aug 2022 21:31:48 +0100 Subject: [PATCH] Remove debugging code --- api/views.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/api/views.py b/api/views.py index 5b6b5c2..34c1adf 100644 --- a/api/views.py +++ b/api/views.py @@ -409,13 +409,25 @@ class API(object): @app.route("/irc/auto//", methods=["POST"]) @login_required def irc_auto_network(self, request, net): - print(repr(main.network[net].relays.keys())) if net not in main.network.keys(): return dumps({"success": False, "reason": "no such net."}) if 1 in main.network[net].relays.keys(): - return dumps({"success": False, "reason": f"First relay exists on {net}"}) + return dumps({"success": False, "reason": f"first relay exists on {net}"}) num, alias = main.network[net].add_relay(1) provision.provisionRelay(num, net) main.saveConf("network") - return dumps({"success": True, f"message": "Created relay {num} with alias {alias} on {net}"}) + return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"}) + + @app.route("/irc/list//", methods=["POST"]) + @login_required + def irc_list_network(self, request, net): + if net not in main.network.keys(): + return dumps({"success": False, "reason": "no such net."}) + if 1 not in main.network[net].relays.keys(): + return dumps({"success": False, "reason": f"no first relay on {net}"}) + num, alias = main.network[net].add_relay(1) + provision.provisionRelay(num, net) + main.saveConf("network") + + return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"}) \ No newline at end of file