Add sinst to contexts
This commit is contained in:
parent
85c6521b07
commit
3b176e0a4a
|
@ -128,12 +128,16 @@ class ThresholdIRCNetworkRelayDel(SuperUserRequiredMixin, APIView):
|
||||||
message = deleted["reason"]
|
message = deleted["reason"]
|
||||||
message_class = "danger"
|
message_class = "danger"
|
||||||
relays = threshold.get_irc_relays(net)
|
relays = threshold.get_irc_relays(net)
|
||||||
|
sinst = threshold.get_irc_sinst(net)
|
||||||
context = {
|
context = {
|
||||||
"net": net,
|
"net": net,
|
||||||
"message": message,
|
"message": message,
|
||||||
"class": message_class,
|
"class": message_class,
|
||||||
"relays": relays["relays"],
|
"relays": relays["relays"],
|
||||||
}
|
}
|
||||||
|
if sinst:
|
||||||
|
if sinst["success"]:
|
||||||
|
context["sinst"] = sinst["sinst"]
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,12 +157,16 @@ class ThresholdIRCNetworkRelayProvision(SuperUserRequiredMixin, APIView):
|
||||||
message = provisioned["reason"]
|
message = provisioned["reason"]
|
||||||
message_class = "danger"
|
message_class = "danger"
|
||||||
relays = threshold.get_irc_relays(net)
|
relays = threshold.get_irc_relays(net)
|
||||||
|
sinst = threshold.get_irc_sinst(net)
|
||||||
context = {
|
context = {
|
||||||
"net": net,
|
"net": net,
|
||||||
"message": message,
|
"message": message,
|
||||||
"class": message_class,
|
"class": message_class,
|
||||||
"relays": relays["relays"],
|
"relays": relays["relays"],
|
||||||
}
|
}
|
||||||
|
if sinst:
|
||||||
|
if sinst["success"]:
|
||||||
|
context["sinst"] = sinst["sinst"]
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,12 +186,16 @@ class ThresholdIRCNetworkRelayAuth(SuperUserRequiredMixin, APIView):
|
||||||
message = provisioned["reason"]
|
message = provisioned["reason"]
|
||||||
message_class = "danger"
|
message_class = "danger"
|
||||||
relays = threshold.get_irc_relays(net)
|
relays = threshold.get_irc_relays(net)
|
||||||
|
sinst = threshold.get_irc_sinst(net)
|
||||||
context = {
|
context = {
|
||||||
"net": net,
|
"net": net,
|
||||||
"message": message,
|
"message": message,
|
||||||
"class": message_class,
|
"class": message_class,
|
||||||
"relays": relays["relays"],
|
"relays": relays["relays"],
|
||||||
}
|
}
|
||||||
|
if sinst:
|
||||||
|
if sinst["success"]:
|
||||||
|
context["sinst"] = sinst["sinst"]
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,11 +217,15 @@ class ThresholdIRCNetworkRelayStatus(SuperUserRequiredMixin, APIView):
|
||||||
message = "Error updating status"
|
message = "Error updating status"
|
||||||
message_class = "danger"
|
message_class = "danger"
|
||||||
relays = threshold.get_irc_relays(net)
|
relays = threshold.get_irc_relays(net)
|
||||||
|
sinst = threshold.get_irc_sinst(net)
|
||||||
context = {
|
context = {
|
||||||
"relays": relays["relays"],
|
"relays": relays["relays"],
|
||||||
"message": message,
|
"message": message,
|
||||||
"class": message_class,
|
"class": message_class,
|
||||||
}
|
}
|
||||||
|
if sinst:
|
||||||
|
if sinst["success"]:
|
||||||
|
context["sinst"] = sinst["sinst"]
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue