Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename get_country_codes to get_mapped_country_codes_from_string
michalec4f16367255
diff --git a/saleor/core/utils/filters.py b/saleor/core/utils/filters.pyindex 1a366746fb..163938d4dd 100644--- a/saleor/core/utils/filters.py+++ b/saleor/core/utils/filters.py@@ -28,13 +28,13 @@ def filter_by_customer(queryset, name, value):def filter_by_location(queryset, name, value):q = Q(default_billing_address__city__icontains=value)q |= Q(default_billing_address__country__icontains=value)- country_codes = get_country_codes(value)+ country_codes = get_mapped_country_codes_from_string(value)for code in country_codes:q |= Q(default_billing_address__country__icontains=code)return queryset.filter(q)-def get_country_codes(value):+def get_mapped_country_codes_from_string(value):country_codes = []for code, country in dict(countries).items():if value.lower() in country.lower():diff --git a/saleor/dashboard/order/filters.py b/saleor/dashboard/order/filters.pyindex 4d6274133c..2a92b454e4 100644--- a/saleor/dashboard/order/filters.py+++ b/saleor/dashboard/order/filters.py@@ -3,7 +3,6 @@ from __future__ import unicode_literalsfrom django_filters import (CharFilter, ChoiceFilter, DateFromToRangeFilter, FilterSet, RangeFilter,OrderingFilter)-from django import formsfrom django.utils.translation import pgettext_lazyfrom django_prices.models import PriceFieldfrom payments import PaymentStatus