Commit e0f32040 by Czémán Arnold

dashboard: fix VmRenameView

parent fdf0285a
Pipeline #210 passed with stage
in 0 seconds
......@@ -735,10 +735,9 @@ class VmRenameView(FormOperationMixin, VmOperationView):
extra.update(form.cleaned_data)
resp = super(FormOperationMixin, self).post(
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():
return JsonResponse({'new_name': new_name})
return JsonResponse({'new_name': extra['new_name']})
else:
messages.success(request, success_message)
return resp
......
......@@ -1411,7 +1411,6 @@ class RenameOperation(InstanceOperation):
required_perms = ()
def _operation(self, user, activity, new_name):
old_name = self.instance.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