Skip to content

Commit 6a9d891

Browse files
committed
Always use lowercase country code in validate method
1 parent c20d181 commit 6a9d891

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_session_id():
4646

4747

4848
# Get supported countries for dropdown choices
49-
country_choices = [(country['name'], country['iso3'].lower()) for country in get_supported_countries()]
49+
country_choices = [(country['name'], country['iso3']) for country in get_supported_countries()]
5050
initial_context = country_choices[0][1]
5151

5252
with gr.Blocks() as demo:
@@ -85,9 +85,9 @@ def get_session_id():
8585
gr.Examples(
8686
example_labels=["Correct typo's", 'Ambiguous matches', 'Valid address'],
8787
examples=[
88-
['bel', '2000', 'antwerpn', 'leystraat', '11', '', ''],
89-
['nld', '', 'Winsum', 'Postbus', '1', '', ''],
90-
['nor', '0150', 'Oslo', '', '', '', 'Kirsten Flagstads plass 1'],
88+
['BEL', '2000', 'antwerpn', 'leystraat', '11', '', ''],
89+
['NLD', '', 'Winsum', 'Postbus', '1', '', ''],
90+
['NOR', '0150', 'Oslo', '', '', '', 'Kirsten Flagstads plass 1'],
9191
],
9292
inputs=validate_inputs,
9393
)

src/postcode_eu_api_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def validate(
229229
"""
230230
url_parts = [
231231
'international/v1/validate',
232-
quote(country, safe='')
232+
quote(country.lower(), safe='')
233233
]
234234

235235
variables = {

0 commit comments

Comments
 (0)