From 3d2ce279548809c1de71ab6b13d4fdb343a20931 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 7 May 2018 06:29:53 +0530 Subject: [PATCH] fix discount amount --- datacenterlight/views.py | 2 +- hosting/views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 79411fbb..ec10a341 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -172,7 +172,7 @@ class IndexView(CreateView): 'vat': vat, 'vat_percent': vat_percent, 'discount': discount, - 'total_price': price + vat - discount.amount, + 'total_price': price + vat - discount['amount'], 'pricing_name': vm_pricing_name } request.session['specs'] = specs diff --git a/hosting/views.py b/hosting/views.py index 7b3cc357..ec583a9b 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -764,7 +764,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): context['vm']['price'] = price context['vm']['discount'] = discount context['vm']['vat_percent'] = vat_percent - context['vm']['total_price'] = price + vat - discount.amount + context['vm']['total_price'] = price + vat - discount['amount'] context['subscription_end_date'] = vm_detail.end_date() except VMDetail.DoesNotExist: try: @@ -785,7 +785,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): context['vm']['discount'] = discount context['vm']['vat_percent'] = vat_percent context['vm']['total_price'] = price + \ - vat - discount.amount + vat - discount['amount'] except WrongIdError: messages.error( self.request, @@ -1085,7 +1085,7 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): 'price': price, 'vat': vat, 'vat_percent': vat_percent, - 'total_price': price + vat - discount.amount, + 'total_price': price + vat - discount['amount'], 'pricing_name': vm_pricing_name }