Handle the net being None or 'None'

This commit is contained in:
Mark Veidemanis 2022-08-18 07:20:30 +01:00
parent e4fad1e7bc
commit 65fddc5fe9
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 5 additions and 1 deletions

View File

@ -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: