From f5372ecd1e622a41ac1701783a8a7804c06a9dfe Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 15 Nov 2019 13:20:14 +0530 Subject: [PATCH] Fix bug: use country startswith instead of exact matching Countries like FR are represented as FR MC --- utils/hosting_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index d3492a64..75e6c3de 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -154,7 +154,7 @@ def get_vat_rate_for_country(country): vat_rate = None try: vat_rate = VATRates.objects.get( - territory_codes=country, start_date__isnull=False, stop_date=None + territory_codes__startswith=country, start_date__isnull=False, stop_date=None ) logger.debug("VAT rate for %s is %s" % (country, vat_rate.rate)) return vat_rate.rate @@ -164,7 +164,6 @@ def get_vat_rate_for_country(country): return 0 - class HostingUtils: @staticmethod def clear_items_from_list(from_list, items_list):