diff --git a/hosting/views.py b/hosting/views.py index 201f590a..acd7e67b 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -972,10 +972,13 @@ class VirtualMachineView(LoginRequiredMixin, View): for t in range(15): try: manager.get_vm(self.kwargs.get('pk')) - except BaseException: + except WrongIdError: response['status'] = True response['redirect'] = self.get_success_url() response['text'] = ugettext('Terminated') + self.send_mail() + break + except BaseException: break else: sleep(2)