Commit 73724790 by Oláh István Gergely

dashboard: fix change_status message

parent 940c9070
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<form action="" method="POST"> <form action="" method="POST">
{% csrf_token %} {% csrf_token %}
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<input type="hidden" name="change_status" value="_"/> <input type="hidden" name="change_status" value=""/>
<button class="btn btn-warning">Yes, {{ status }}</button> <button class="btn btn-warning">Yes, {{ status }}</button>
</form> </form>
</div> </div>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<form action="" method="POST"> <form action="" method="POST">
{% csrf_token %} {% csrf_token %}
<a class="btn btn-default">Back</a> <a class="btn btn-default">Back</a>
<input type="hidden" name="change_status" value="_"/> <input type="hidden" name="change_status" value=""/>
<button class="btn btn-warning">Yes, {{ status }}</button> <button class="btn btn-warning">Yes, {{ status }}</button>
</form> </form>
</div> </div>
......
...@@ -454,9 +454,10 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView): ...@@ -454,9 +454,10 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
print request.POST
if request.POST.get('new_name'): if request.POST.get('new_name'):
return self.__set_name(request) return self.__set_name(request)
if request.POST.get('change_status'): if request.POST.get('change_status') is not None:
return self.__set_status(request) return self.__set_status(request)
return redirect(reverse_lazy("dashboard.views.node-detail", return redirect(reverse_lazy("dashboard.views.node-detail",
kwargs={'pk': self.get_object().pk})) kwargs={'pk': self.get_object().pk}))
...@@ -1261,7 +1262,7 @@ class NodeStatus(LoginRequiredMixin, SuperuserRequiredMixin, DetailView): ...@@ -1261,7 +1262,7 @@ class NodeStatus(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if request.POST.get('change_status'): if request.POST.get('change_status') is not None:
return self.__set_status(request) return self.__set_status(request)
return redirect(reverse_lazy("dashboard.views.node-detail", return redirect(reverse_lazy("dashboard.views.node-detail",
kwargs={'pk': self.get_object().pk})) kwargs={'pk': self.get_object().pk}))
......
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