From c2f8ae1eb393b8477fcead0cbb2da3720c065844 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sat, 17 Jun 2017 13:41:18 +0530 Subject: [PATCH 1/2] Fixed a responsive issue in signup/email confirmation --- hosting/templates/hosting/signup_validate.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"%}

From bf99bd5edb5a3509300f7550df28b87e0501a6ed Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sat, 17 Jun 2017 14:46:11 +0530 Subject: [PATCH 2/2] Fixed redirecting user to list vm page, if he requests for details of a vm whose id does not belong to him --- hosting/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 87d5bad0..45e23df4 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -742,6 +742,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 \ @@ -758,6 +764,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 = {