Commit e0f32040 by Czémán Arnold

dashboard: fix VmRenameView

parent fdf0285a
...@@ -735,10 +735,9 @@ class VmRenameView(FormOperationMixin, VmOperationView): ...@@ -735,10 +735,9 @@ class VmRenameView(FormOperationMixin, VmOperationView):
extra.update(form.cleaned_data) extra.update(form.cleaned_data)
resp = super(FormOperationMixin, self).post( resp = super(FormOperationMixin, self).post(
request, extra, *args, **kwargs) request, extra, *args, **kwargs)
new_name = request.POST.get("new_name") success_message = _('VM successfully renamed.')
success_message = _("VM successfully renamed.")
if request.is_ajax(): if request.is_ajax():
return JsonResponse({'new_name': new_name}) return JsonResponse({'new_name': extra['new_name']})
else: else:
messages.success(request, success_message) messages.success(request, success_message)
return resp return resp
......
...@@ -1411,7 +1411,6 @@ class RenameOperation(InstanceOperation): ...@@ -1411,7 +1411,6 @@ class RenameOperation(InstanceOperation):
required_perms = () required_perms = ()
def _operation(self, user, activity, new_name): def _operation(self, user, activity, new_name):
old_name = self.instance.name old_name = self.instance.name
self.instance.name = new_name self.instance.name = new_name
......
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