Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove redundant function

Mira Szewczykb36d26c9cd97
diff --git a/saleor/cart/views.py b/saleor/cart/views.py
index ae3e6c826c..513b15cfe1 100644
--- a/saleor/cart/views.py
+++ b/saleor/cart/views.py
@@ -9,7 +9,6 @@ from django.template.response import TemplateResponse
from . import decorators
from ..core.utils import to_local_currency, get_default_country
from ..product.models import ProductVariant
-from ..shipping.utils import assign_shipment_to_country
from .forms import ReplaceCartLineForm, CountryForm
from .models import Cart
from .utils import check_product_availability_and_warn
@@ -33,7 +32,6 @@ def index(request, cart):
cart_total = None
local_cart_total = None
- shipment_by_country = assign_shipment_to_country()
if cart:
cart_total = cart.get_total(discounts=discounts)
local_cart_total = to_local_currency(cart_total, request.currency)
@@ -48,8 +46,7 @@ def index(request, cart):
'cart_lines': cart_lines,
'cart_total': cart_total,
'local_cart_total': local_cart_total,
- 'country_form': country_form,
- 'shipment_by_country': shipment_by_country})
+ 'country_form': country_form})
@decorators.get_or_empty_db_cart()
diff --git a/saleor/shipping/utils.py b/saleor/shipping/utils.py
deleted file mode 100644
index 0798b69400..0000000000
--- a/saleor/shipping/utils.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from .models import ShippingMethodCountry, COUNTRY_CODE_CHOICES
-
-
-def assign_shipment_to_country():
- shippments = {}
- for code in COUNTRY_CODE_CHOICES:
- shippments[code[0]] = ShippingMethodCountry.objects.select_related(
- 'shipping_method').filter(country_code=code)
- return shippments