Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
convert tax directory into file
Maciej Korycinski7c6781faef06
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.pyindex 520cec8c1f..fc632a761b 100644--- a/saleor/checkout/views/summary.py+++ b/saleor/checkout/views/summary.py@@ -7,7 +7,7 @@ from django.utils.translation import pgettextfrom ...account.models import Addressfrom ...core import analyticsfrom ...core.exceptions import InsufficientStock-from ...core.taxes.errors import TaxError+from ...core.taxes import TaxErrorfrom ...discount.models import NotApplicablefrom ..forms import CheckoutNoteFormfrom ..utils import (diff --git a/saleor/core/extensions/plugins/avatax/plugin.py b/saleor/core/extensions/plugins/avatax/plugin.pyindex 8b0eadcd48..bbda77161b 100644--- a/saleor/core/extensions/plugins/avatax/plugin.py+++ b/saleor/core/extensions/plugins/avatax/plugin.py@@ -6,8 +6,7 @@ from urllib.parse import urljoinfrom django.conf import settingsfrom prices import Money, TaxedMoney, TaxedMoneyRange-from ....taxes import TaxType, zero_taxed_money-from ....taxes.errors import TaxError+from ....taxes import TaxError, TaxType, zero_taxed_moneyfrom ...plugin import BasePluginfrom . import (META_FIELD,diff --git a/saleor/core/taxes/__init__.py b/saleor/core/taxes.pysimilarity index 96%rename from saleor/core/taxes/__init__.pyrename to saleor/core/taxes.pyindex 8e11b50c08..5e285d298e 100644--- a/saleor/core/taxes/__init__.py+++ b/saleor/core/taxes.py@@ -8,6 +8,10 @@ from django.contrib.sites.models import Sitefrom prices import Money, MoneyRange, TaxedMoney, TaxedMoneyRange+class TaxError(Exception):+ """Default tax error"""++def zero_money(currency=settings.DEFAULT_CURRENCY):"""Function used as a model's default."""return Money(0, currency)diff --git a/saleor/core/taxes/errors.py b/saleor/core/taxes/errors.pydeleted file mode 100644index 4a216d9bb5..0000000000--- a/saleor/core/taxes/errors.py+++ /dev/null@@ -1,2 +0,0 @@-class TaxError(Exception):- """Default tax error"""diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.pyindex 1a3819d2e8..1b9fcec20c 100644--- a/saleor/graphql/checkout/mutations.py+++ b/saleor/graphql/checkout/mutations.py@@ -24,7 +24,7 @@ from ...checkout.utils import (from ...core import analyticsfrom ...core.exceptions import InsufficientStockfrom ...core.extensions.manager import get_extensions_manager-from ...core.taxes.errors import TaxError+from ...core.taxes import TaxErrorfrom ...discount import models as voucher_modelfrom ...payment import PaymentErrorfrom ...payment.interface import AddressData