Commit 386b5d3e by Oláh István Gergely

dashboard: change filter+update to enable-disable in NodeStatus

parent 2410e2e1
......@@ -1269,11 +1269,9 @@ class NodeStatus(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
def __set_status(self, request):
self.object = self.get_object()
if not self.object.enabled:
Node.objects.filter(pk=self.object.pk).update(
**{'enabled': True})
self.object.enable(user=request.user)
else:
Node.objects.filter(pk=self.object.pk).update(
**{'enabled': False})
self.object.disable(user=request.user)
success_message = _("Node successfully changed status!")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment