diff --git a/app/urls.py b/app/urls.py index 2a7d6f0..91d7c3a 100644 --- a/app/urls.py +++ b/app/urls.py @@ -48,6 +48,7 @@ from core.views.manage.threshold.irc import ( ThresholdIRCOverviewAlerts, ThresholdIRCSendMessage, ThresholdIRCStats, + ThresholdIRCNetworkChannelsAPI, ) # Management stuff @@ -199,6 +200,11 @@ urlpatterns = [ ThresholdIRCNetworkChannels.as_view(), name="threshold_irc_network_channels", ), + path( + "manage/threshold/irc/network//channel/json/", + ThresholdIRCNetworkChannelsAPI.as_view(), + name="threshold_irc_network_channel_json", + ), path( "manage/threshold/irc/network//channel//", ThresholdIRCNetworkChannels.as_view(), diff --git a/core/lib/manage/threshold.py b/core/lib/manage/threshold.py index c2a4fc6..04afc0a 100644 --- a/core/lib/manage/threshold.py +++ b/core/lib/manage/threshold.py @@ -66,9 +66,8 @@ def get_irc_channels(net): def part_channel(net, channel): - channel = urllib.parse.quote(channel, safe="") - url = f"irc/network/{net}/channel/{channel}" - payload = {} + url = f"irc/network/{net}/channel" + payload = {"channel": channel} parted = threshold_request(url, payload, method="DELETE") if not parted: return {} diff --git a/core/templates/manage/threshold/irc/network/channels.html b/core/templates/manage/threshold/irc/network/channels.html index 5a95818..f87db4c 100644 --- a/core/templates/manage/threshold/irc/network/channels.html +++ b/core/templates/manage/threshold/irc/network/channels.html @@ -23,8 +23,9 @@