Skip to content

Commit 7c049fa

Browse files
further changes for BE region
1 parent 8d4a211 commit 7c049fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

l10n_CM/run_l10n.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060

6161
loaded_valid_sites = valid_l10n_mappings().keys()
6262
valid_sites = valid_sites.union(set(loaded_valid_sites))
63-
6463
live_sites = []
6564

6665

modules/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,13 @@ def create_localized_faker(self, country_code: str):
219219
"""
220220

221221
# Check if locale exists, otherwise return None
222-
locale = next(filter(lambda x: country_code in x, AVAILABLE_LOCALES[::-1]), None)
222+
locales = list(filter(lambda x: country_code in x, AVAILABLE_LOCALES))
223223

224-
if not locale:
224+
if not locales:
225225
logging.error(f"Invalid country code `{country_code}`. No faker instance created.")
226226
return None # No fallback
227227

228+
locale = next(filter(lambda x: 'en' in x, locales), locales[-1])
228229
try:
229230
# seed to get consistent data
230231
if self.fake is None:
@@ -299,7 +300,7 @@ def fake_autofill_data(self, country_code) -> AutofillAddressBase:
299300
getattr(fake, valid_attribute)() if valid_attribute else valid_attribute
300301
)
301302
address_level_2 = fake.city()
302-
postal_code = fake.postcode()[:4]
303+
postal_code = fake.postcode()
303304
country = fake.current_country()
304305
email = fake.email()
305306
telephone = self.generate_localized_phone(country_code, fake)

0 commit comments

Comments
 (0)