Skip to content

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

Shipping method get initial value

Jon Lawrence88ce0d0dbb3c
diff --git a/saleor/checkout/forms.py b/saleor/checkout/forms.py
index b785be26d3..29f515381b 100644
--- a/saleor/checkout/forms.py
+++ b/saleor/checkout/forms.py
@@ -90,8 +90,10 @@ class ShippingMethodForm(forms.Form):
queryset = method_field.queryset
method_field.queryset = queryset.unique_for_country_code(
country_code)
+
if self.initial.get('method') is None:
- method_field.initial = method_field.queryset.first()
+ self.initial['method'] = method_field.queryset.first()
+
method_field.empty_label = None