Skip to content

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

Add city area type and city choices to address validator API

Unknown8d00c5cc1683
diff --git a/saleor/graphql/account/resolvers.py b/saleor/graphql/account/resolvers.py
index a99bcad12d..fe882433a3 100644
--- a/saleor/graphql/account/resolvers.py
+++ b/saleor/graphql/account/resolvers.py
@@ -60,8 +60,13 @@ def resolve_address_validator(info, input):
ChoiceValue(area[0], area[1])
for area in rules.country_area_choices],
city_type=rules.city_type,
+ city_choices=[
+ ChoiceValue(area[0], area[1])
+ for area in rules.city_choices],
+ city_area_type=rules.city_type,
city_area_choices=[
- ChoiceValue(area[0], area[1]) for area in rules.city_area_choices],
+ ChoiceValue(area[0], area[1])
+ for area in rules.city_area_choices],
postal_code_type=rules.postal_code_type,
postal_code_matchers=[
compiled.pattern for compiled in rules.postal_code_matchers],
diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.py
index 8cf4592adf..1dbc65a299 100644
--- a/saleor/graphql/account/types.py
+++ b/saleor/graphql/account/types.py
@@ -113,6 +113,8 @@ class AddressValidationData(graphene.ObjectType):
country_area_type = graphene.String()
country_area_choices = graphene.List(ChoiceValue)
city_type = graphene.String()
+ city_choices = graphene.List(ChoiceValue)
+ city_area_type = graphene.String()
city_area_choices = graphene.List(ChoiceValue)
postal_code_type = graphene.String()
postal_code_matchers = graphene.List(graphene.String)