From de481e81144d2d4478c33a84478119fde42c2c07 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sat, 19 Aug 2017 02:32:37 +0530 Subject: [PATCH] invoice link fixed --- hosting/templates/hosting/virtual_machine_detail.html | 2 +- hosting/views.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hosting/templates/hosting/virtual_machine_detail.html b/hosting/templates/hosting/virtual_machine_detail.html index 7badfe14..5efa82bf 100644 --- a/hosting/templates/hosting/virtual_machine_detail.html +++ b/hosting/templates/hosting/virtual_machine_detail.html @@ -81,7 +81,7 @@
- {% trans "BACK TO LIST" %} + {% trans "BACK TO LIST" %}
diff --git a/hosting/views.py b/hosting/views.py index d9cdefb6..3c2edbbb 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -822,10 +822,6 @@ class VirtualMachineView(LoginRequiredMixin, View): print(error) raise Http404() - def get_context_data(self): - context = super(VirtualMachineView, self).get_context_data(**kwargs) - context['order'] = HostingOrder.objects.get(vm_id=context['vm'].id) - def get_success_url(self): final_url = reverse('hosting:virtual_machines') return final_url @@ -838,6 +834,7 @@ class VirtualMachineView(LoginRequiredMixin, View): serializer = VirtualMachineSerializer(vm) context = { 'virtual_machine': serializer.data, + 'order': HostingOrder.objects.get(vm_id=serializer.data['vm_id']) } except: pass