Skip to content

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

Sort displayed list of countries

Mira Szewczyk346d1d90fcc3
diff --git a/saleor/cart/forms.py b/saleor/cart/forms.py
index 9f6934bb22..3b6c115970 100644
--- a/saleor/cart/forms.py
+++ b/saleor/cart/forms.py
@@ -118,7 +118,8 @@ class ReplaceCartLineForm(AddToCartForm):
class CountryForm(forms.Form):
- country = forms.ChoiceField(choices=COUNTRY_CODE_CHOICES, label='')
+ country = forms.ChoiceField(
+ choices=sorted(COUNTRY_CODE_CHOICES, key=lambda t: t[1]), label='')
def get_shipment_options(self):
code = self.cleaned_data['country']