Getting VM name for serializer data, hence fixing the problem of public- appearing in VM cancellation email

This commit is contained in:
PCoder 2017-09-09 12:12:56 +05:30
parent be55e2613d
commit 1d5f92f7e1

View file

@ -933,7 +933,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
email=owner.email, email=owner.email,
password=owner.password password=owner.password
) )
vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data
terminated = manager.delete_vm( terminated = manager.delete_vm(
vm.id vm.id
) )
@ -945,7 +945,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
) )
return HttpResponseRedirect(self.get_success_url()) return HttpResponseRedirect(self.get_success_url())
context = { context = {
'vm': vm, 'vm': vm_data,
'base_url': "{0}://{1}".format(self.request.scheme, 'base_url': "{0}://{1}".format(self.request.scheme,
self.request.get_host()), self.request.get_host()),
'page_header': _('Virtual Machine Cancellation') 'page_header': _('Virtual Machine Cancellation')