Commit 6d848036 by Őry Máté

dashboard: fix some mass_ops issues

parent bb377d91
...@@ -501,9 +501,9 @@ def fetch_human_exception(exception, user=None): ...@@ -501,9 +501,9 @@ def fetch_human_exception(exception, user=None):
if isinstance(exception, PermissionDenied): if isinstance(exception, PermissionDenied):
exception = create_readable(ugettext_noop("Permission Denied")) exception = create_readable(ugettext_noop("Permission Denied"))
else: else:
exception = create_readable( exception = create_readable(ugettext_noop("Unknown error"),
_("Unknown error"), _("Unknown error: %(ex)s"), ugettext_noop("Unknown error: %(ex)s"),
ex=unicode(exception)).get_text() ex=unicode(exception))
return exception.get_text(user) if user else exception return exception.get_text(user) if user else exception
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</label> </label>
<input id="migrate-to-none" type="radio" name="node" value="" style="float: right;" checked="checked"> <input id="migrate-to-none" type="radio" name="node" value="" style="float: right;" checked="checked">
<span class="vm-migrate-node-property"> <span class="vm-migrate-node-property">
{% trans "This option will reschedule each virtual machine to the most optimal node." %} {% trans "This option will reschedule each virtual machine to the optimal node." %}
</span> </span>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
......
...@@ -1025,6 +1025,7 @@ class MassOperationView(OperationView): ...@@ -1025,6 +1025,7 @@ class MassOperationView(OperationView):
template_name = 'dashboard/mass-operate.html' template_name = 'dashboard/mass-operate.html'
def check_auth(self): def check_auth(self):
self.get_op().check_perms(self.request.user)
for i in self.get_object(): for i in self.get_object():
if not i.has_level(self.request.user, "user"): if not i.has_level(self.request.user, "user"):
raise PermissionDenied( raise PermissionDenied(
...@@ -1100,7 +1101,7 @@ class MassOperationView(OperationView): ...@@ -1100,7 +1101,7 @@ class MassOperationView(OperationView):
store.used = True store.used = True
return HttpResponse( return HttpResponse(
json.dumps({'messages': [unicode(m) for m in store]}), json.dumps({'messages': [unicode(m) for m in store]}),
content_type="application=json" content_type="application/json"
) )
else: else:
return redirect(reverse("dashboard.views.vm-list")) return redirect(reverse("dashboard.views.vm-list"))
......
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