From 65fddc5fe9353624659f028ac3456fa73a99ecd2 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 18 Aug 2022 07:20:30 +0100 Subject: [PATCH] Handle the net being None or 'None' --- core/views/manage/threshold/irc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/views/manage/threshold/irc.py b/core/views/manage/threshold/irc.py index e4efdd3..cc767c9 100644 --- a/core/views/manage/threshold/irc.py +++ b/core/views/manage/threshold/irc.py @@ -400,9 +400,11 @@ class ThresholdIRCActionsRegistration(SuperUserRequiredMixin, APIView): """ Get registration modal """ - unreg = threshold.irc_get_unreg(net) message = None message_class = None + if net == "None": + net = None + unreg = threshold.irc_get_unreg(net) if not unreg: message = "Could not get registration status." message_class = "danger" @@ -428,6 +430,8 @@ class ThresholdIRCActionsRegistration(SuperUserRequiredMixin, APIView): """ message = None message_class = None + if net == "None": + net = None if request.resolver_match.url_name == "threshold_irc_actions_registration_net": template_name = "manage/threshold/irc/network/actions.html" else: