Implement deleting networks
This commit is contained in:
parent
b42c82eac2
commit
4c8b584ef4
10
api/views.py
10
api/views.py
|
@ -211,6 +211,16 @@ class API(object):
|
||||||
network["records"] = userinfo.getNumWhoEntries(net)
|
network["records"] = userinfo.getNumWhoEntries(net)
|
||||||
return dumps(network)
|
return dumps(network)
|
||||||
|
|
||||||
|
@app.route("/irc/network/<net>/", methods=["DELETE"])
|
||||||
|
@login_required
|
||||||
|
def irc_network_delete(self, request, net):
|
||||||
|
if net not in main.network.keys():
|
||||||
|
return dumps({"success": False, "reason": "no such net."})
|
||||||
|
main.network[net].seppuku()
|
||||||
|
del main.network[net]
|
||||||
|
main.saveConf("network")
|
||||||
|
return dumps({"success": True})
|
||||||
|
|
||||||
@app.route("/irc/network/<net>/edit/", methods=["POST"])
|
@app.route("/irc/network/<net>/edit/", methods=["POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def irc_network_edit(self, request, net):
|
def irc_network_edit(self, request, net):
|
||||||
|
|
Loading…
Reference in New Issue