Commit 64e4e9d5 by Guba Sándor

dashboard/views: fixed node state change to user model.Node

parent d56aeab7
......@@ -465,11 +465,9 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
self.object = self.get_object()
new_status = request.POST.get("new_status")
if new_status == "enable":
Node.objects.filter(pk=self.object.pk).update(
**{'enabled': True})
self.object.enable(user=request.user)
elif new_status == "disable":
Node.objects.filter(pk=self.object.pk).update(
**{'enabled': False})
self.object.disable(user=request.user)
else:
return
......
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