Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve country select form
Artur Smęt035f5c390eed
diff --git a/saleor/cart/forms.py b/saleor/cart/forms.pyindex be52ac2b1b..7aedd13cf0 100644--- a/saleor/cart/forms.py+++ b/saleor/cart/forms.py@@ -3,8 +3,8 @@ from __future__ import unicode_literalsfrom django import formsfrom django.core.exceptions import ObjectDoesNotExist, NON_FIELD_ERRORSfrom django.utils.translation import pgettext_lazy, ugettext_lazy+from django_countries.fields import LazyTypedChoiceField, countriesfrom satchless.item import InsufficientStock-from ..shipping.models import COUNTRY_CODE_CHOICESfrom ..shipping.utils import get_shipment_options@@ -118,8 +118,7 @@ class ReplaceCartLineForm(AddToCartForm):class CountryForm(forms.Form):- country = forms.ChoiceField(choices=COUNTRY_CODE_CHOICES, label='',- required=False)+ country = LazyTypedChoiceField(choices=countries)def get_shipment_options(self):code = self.cleaned_data['country']