Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add code comment
Pacu2914777187df3
diff --git a/saleor/account/i18n.py b/saleor/account/i18n.pyindex 02465b7ccf..03673442bc 100644--- a/saleor/account/i18n.py+++ b/saleor/account/i18n.py@@ -4,7 +4,6 @@ import i18naddressfrom django import formsfrom django.forms.forms import BoundFieldfrom django.utils.translation import pgettext_lazy-from django_countries import countriesfrom django_countries.data import COUNTRIESfrom phonenumber_field.formfields import PhoneNumberField@@ -123,7 +122,10 @@ class AddressForm(forms.ModelForm):def __init__(self, *args, **kwargs):autocomplete_type = kwargs.pop('autocomplete_type', None)super().__init__(*args, **kwargs)- self.fields['country'].choices = countries+ # countries order was taken as defined in the model,+ # not being sorted accordingly to the selected language+ self.fields['country'].choices = sorted(+ COUNTRY_CHOICES, key=lambda choice: choice[1])autocomplete_dict = defaultdict(lambda: 'off', self.AUTOCOMPLETE_MAPPING)for field_name, field in self.fields.items():