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