Fix authed variable and switch join/part API to use JSON
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.shortcuts import render
|
||||
from django.views import View
|
||||
from rest_framework.parsers import FormParser, JSONParser
|
||||
from rest_framework.parsers import FormParser
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from core.lib.manage import threshold
|
||||
@@ -208,6 +208,7 @@ class ThresholdIRCNetworkRelayStatus(SuperUserRequiredMixin, APIView):
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class ThresholdIRCNetworkChannelsAPI(SuperUserRequiredMixin, APIView):
|
||||
template_name = "manage/threshold/irc/network/channels.html"
|
||||
parser_classes = [FormParser]
|
||||
@@ -219,7 +220,6 @@ class ThresholdIRCNetworkChannelsAPI(SuperUserRequiredMixin, APIView):
|
||||
:param channel: channel name
|
||||
"""
|
||||
channel = request.data["channel"]
|
||||
print("DELETE CHANNEL", channel)
|
||||
parted = threshold.part_channel(net, channel)
|
||||
if parted["success"]:
|
||||
message = f"Requested part on relays: {', '.join(parted['relays'])}"
|
||||
@@ -264,6 +264,7 @@ class ThresholdIRCNetworkChannelsAPI(SuperUserRequiredMixin, APIView):
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class ThresholdIRCNetworkChannels(SuperUserRequiredMixin, APIView):
|
||||
"""
|
||||
List the channels a network is on.
|
||||
|
||||
Reference in New Issue
Block a user