Commit ab55fbae by Őry Máté

dashboard: make abort view more generic

parent 2e3d4c2d
......@@ -12,9 +12,9 @@
{% if user.is_superuser and a.is_abortable %}
<form action="" method="POST" class="pull-right">
{% csrf_token %}
<input type="hidden" name="abort_shutdown"/>
<input type="hidden" name="abort_operation"/>
<input type="hidden" name="activity" value="{{ a.pk }}"/>
<button class="btn btn-danger btn-xs"><i class="icon-bolt"></i> {% trans "Abort shutdown" %}</button>
<button class="btn btn-danger btn-xs"><i class="icon-bolt"></i> {% trans "Abort" %}</button>
</form>
{% endif %}
{% if a.children.count > 0 %}
......
......@@ -243,7 +243,7 @@ class VmDetailView(CheckedDetailView):
'to_remove': self.__remove_tag,
'port': self.__add_port,
'new_network_vlan': self.__new_network,
'abort_shutdown': self.__abort_shutdown,
'abort_operation': self.__abort_operation,
}
for k, v in options.iteritems():
if request.POST.get(k) is not None:
......@@ -429,7 +429,7 @@ class VmDetailView(CheckedDetailView):
return redirect("%s#network" % reverse_lazy(
"dashboard.views.detail", kwargs={'pk': self.object.pk}))
def __abort_shutdown(self, request):
def __abort_operation(self, request):
self.object = self.get_object()
if not request.user.is_superuser:
raise PermissionDenied()
......
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