Merge branch 'master' into task/3379/text_style_activation
This commit is contained in:
commit
0a6275bcef
2 changed files with 9 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
{% block content %}
|
||||
<div class="auth-container">
|
||||
<div class="auth-bg"></div>
|
||||
<div class="container">
|
||||
<div class="auth-center">
|
||||
<div class="auth-title">
|
||||
<h2>{% trans "Your VM hosted in Switzerland"%}</h2>
|
||||
</div>
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue