|
|
@ -4,6 +4,7 @@ from rest_framework.parsers import FormParser
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
|
|
|
|
|
|
|
|
from core.lib.manage.threshold import (
|
|
|
|
from core.lib.manage.threshold import (
|
|
|
|
|
|
|
|
edit_irc_network,
|
|
|
|
get_irc_channels,
|
|
|
|
get_irc_channels,
|
|
|
|
get_irc_network,
|
|
|
|
get_irc_network,
|
|
|
|
get_irc_networks,
|
|
|
|
get_irc_networks,
|
|
|
@ -62,9 +63,18 @@ class ThresholdIRCNetworkInfoEdit(SuperUserRequiredMixin, APIView):
|
|
|
|
Returns the info pane with a message about the success.
|
|
|
|
Returns the info pane with a message about the success.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
template_name = "dynamic/manage/threshold/irc/network/info.html"
|
|
|
|
template_name = "dynamic/manage/threshold/irc/network/info.html"
|
|
|
|
|
|
|
|
edited = edit_irc_network(net, request.data)
|
|
|
|
|
|
|
|
if edited["success"]:
|
|
|
|
|
|
|
|
message = "Successfully edited!"
|
|
|
|
|
|
|
|
message_class = "success"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if "reason" in edited:
|
|
|
|
|
|
|
|
message = f"Error editing network: {edited['reason']}"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
message = "Error editing network"
|
|
|
|
|
|
|
|
message_class = "danger"
|
|
|
|
network = get_irc_network(net)
|
|
|
|
network = get_irc_network(net)
|
|
|
|
context = {"network": network, "message": "Edited!", "class": "info"}
|
|
|
|
context = {"network": network, "message": message, "class": message_class}
|
|
|
|
print("REQUEST DATA", net, request.data)
|
|
|
|
|
|
|
|
return render(request, template_name, context)
|
|
|
|
return render(request, template_name, context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|