From 1eff51099c09618e98c35144bc3fafacae269265 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 21 Sep 2017 02:26:42 +0530 Subject: [PATCH] exception handling fix --- hosting/views.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 06d5051c..21444b41 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -967,11 +967,8 @@ class VirtualMachineView(LoginRequiredMixin, View): try: vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data - except BaseException: - return redirect( - reverse('hosting:virtual_machines', - kwargs={'pk': opennebula_vm_id}) - ) + except WrongIdError: + return redirect(reverse('hosting:virtual_machines')) terminated = manager.delete_vm(vm.id)