From 3b176e0a4ae3d89b64773cb7f70582d4740e79b5 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 16 Aug 2022 23:05:27 +0100 Subject: [PATCH] Add sinst to contexts --- core/views/manage/threshold/irc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/views/manage/threshold/irc.py b/core/views/manage/threshold/irc.py index 2101c69..3b1f59d 100644 --- a/core/views/manage/threshold/irc.py +++ b/core/views/manage/threshold/irc.py @@ -128,12 +128,16 @@ class ThresholdIRCNetworkRelayDel(SuperUserRequiredMixin, APIView): message = deleted["reason"] message_class = "danger" relays = threshold.get_irc_relays(net) + sinst = threshold.get_irc_sinst(net) context = { "net": net, "message": message, "class": message_class, "relays": relays["relays"], } + if sinst: + if sinst["success"]: + context["sinst"] = sinst["sinst"] return render(request, self.template_name, context) @@ -153,12 +157,16 @@ class ThresholdIRCNetworkRelayProvision(SuperUserRequiredMixin, APIView): message = provisioned["reason"] message_class = "danger" relays = threshold.get_irc_relays(net) + sinst = threshold.get_irc_sinst(net) context = { "net": net, "message": message, "class": message_class, "relays": relays["relays"], } + if sinst: + if sinst["success"]: + context["sinst"] = sinst["sinst"] return render(request, self.template_name, context) @@ -178,12 +186,16 @@ class ThresholdIRCNetworkRelayAuth(SuperUserRequiredMixin, APIView): message = provisioned["reason"] message_class = "danger" relays = threshold.get_irc_relays(net) + sinst = threshold.get_irc_sinst(net) context = { "net": net, "message": message, "class": message_class, "relays": relays["relays"], } + if sinst: + if sinst["success"]: + context["sinst"] = sinst["sinst"] return render(request, self.template_name, context) @@ -205,11 +217,15 @@ class ThresholdIRCNetworkRelayStatus(SuperUserRequiredMixin, APIView): message = "Error updating status" message_class = "danger" relays = threshold.get_irc_relays(net) + sinst = threshold.get_irc_sinst(net) context = { "relays": relays["relays"], "message": message, "class": message_class, } + if sinst: + if sinst["success"]: + context["sinst"] = sinst["sinst"] return render(request, self.template_name, context)