From 582e95218700074f82706ec864825c1fe11226ef Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 15 Nov 2019 12:24:24 +0530 Subject: [PATCH] Convert VAT rate to decimal to be consistent --- hosting/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index 00c89e11..3fbf3f66 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -1,3 +1,4 @@ +import decimal import json import logging import os @@ -83,7 +84,7 @@ class GenericProduct(AssignPermissionsMixin, models.Model): return self.product_name def get_actual_price(self, vat_rate=None): - VAT = vat_rate if vat_rate is not None else self.product_vat + VAT = decimal.Decimal(vat_rate) if vat_rate is not None else self.product_vat return round( self.product_price + (self.product_price * VAT), 2 )