Implement provisioning relays
This commit is contained in:
@@ -133,6 +133,31 @@ class ThresholdIRCNetworkRelayDel(SuperUserRequiredMixin, APIView):
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class ThresholdIRCNetworkRelayProvision(SuperUserRequiredMixin, APIView):
|
||||
template_name = "manage/threshold/irc/network/relays.html"
|
||||
|
||||
def post(self, request, net, num):
|
||||
"""
|
||||
Provision a relay
|
||||
"""
|
||||
provisioned = threshold.irc_provision_relay(net, num)
|
||||
if provisioned["success"]:
|
||||
|
||||
message = f"Provisioned relay {num}"
|
||||
message_class = "success"
|
||||
else:
|
||||
message = provisioned["reason"]
|
||||
message_class = "danger"
|
||||
relays = threshold.get_irc_relays(net)
|
||||
context = {
|
||||
"net": net,
|
||||
"message": message,
|
||||
"class": message_class,
|
||||
"relays": relays["relays"],
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class ThresholdIRCNetworkRelayStatus(SuperUserRequiredMixin, APIView):
|
||||
template_name = "manage/threshold/irc/network/relays.html"
|
||||
|
||||
|
||||
@@ -260,8 +260,6 @@ class DrilldownContextModal(APIView):
|
||||
query_params["mtype"] = None
|
||||
if request.user.is_superuser:
|
||||
if query_params["type"] in ["query", "notice"]:
|
||||
print("BOT NICK", query_params["channel"])
|
||||
print("QUERY NICK", query_params["nick"])
|
||||
nicks = [query_params["channel"], query_params["nick"]]
|
||||
query_params["sorting"] = "desc"
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user