From 940eaf3a07bf2e587ce5b9d4f68804d7df3354b8 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 15 Nov 2019 12:39:03 +0530 Subject: [PATCH] Process prices as floats --- hosting/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/models.py b/hosting/models.py index 3fbf3f66..b03b833b 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -84,9 +84,9 @@ class GenericProduct(AssignPermissionsMixin, models.Model): return self.product_name def get_actual_price(self, vat_rate=None): - VAT = decimal.Decimal(vat_rate) if vat_rate is not None else self.product_vat + VAT = vat_rate if vat_rate is not None else self.product_vat return round( - self.product_price + (self.product_price * VAT), 2 + float(self.product_price) + float(self.product_price * VAT), 2 )