diff --git a/hosting/templates/hosting/signup_validate.html b/hosting/templates/hosting/signup_validate.html index 00b0561a..3ccbe15b 100644 --- a/hosting/templates/hosting/signup_validate.html +++ b/hosting/templates/hosting/signup_validate.html @@ -4,7 +4,7 @@ {% block content %}
-
+

{% trans "Your VM hosted in Switzerland"%}

diff --git a/hosting/views.py b/hosting/views.py index f63e5421..f5ab73ee 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -755,6 +755,12 @@ class VirtualMachineView(LoginRequiredMixin, View): try: vm = manager.get_vm(vm_id) return vm + except WrongIdError: + messages.error(self.request, + _('We could not find the requested VM. Please \ + contact Data Center Light Support.') + ) + return None except ConnectionRefusedError: messages.error(self.request, 'We could not load your VM due to a backend connection \ @@ -771,6 +777,8 @@ class VirtualMachineView(LoginRequiredMixin, View): def get(self, request, *args, **kwargs): vm = self.get_object() + if vm is None: + return redirect(reverse('hosting:virtual_machines')) try: serializer = VirtualMachineSerializer(vm) context = {