exception handling fix
This commit is contained in:
		
					parent
					
						
							
								f4766c7d7c
							
						
					
				
			
			
				commit
				
					
						1eff51099c
					
				
			
		
					 1 changed files with 2 additions and 5 deletions
				
			
		| 
						 | 
					@ -967,11 +967,8 @@ class VirtualMachineView(LoginRequiredMixin, View):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data
 | 
					            vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data
 | 
				
			||||||
        except BaseException:
 | 
					        except WrongIdError:
 | 
				
			||||||
            return redirect(
 | 
					            return redirect(reverse('hosting:virtual_machines'))
 | 
				
			||||||
                reverse('hosting:virtual_machines',
 | 
					 | 
				
			||||||
                        kwargs={'pk': opennebula_vm_id})
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        terminated = manager.delete_vm(vm.id)
 | 
					        terminated = manager.delete_vm(vm.id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue