From b48996f383f6e4c207ff152f3fdb9c481973b183 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 10 Jan 2018 15:20:16 +0000 Subject: [PATCH] Exclude arabic names from PersonFactory due to difficulties with the romanization of the names in connection with draft author extraction. - Legacy-Id: 14500 --- ietf/person/factories.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ietf/person/factories.py b/ietf/person/factories.py index 6f64c7967..5a4d784b7 100644 --- a/ietf/person/factories.py +++ b/ietf/person/factories.py @@ -19,7 +19,11 @@ from ietf.person.name import unidecode_name fake = faker.Factory.create() def random_faker(): - return faker.Faker(random.sample(faker.config.AVAILABLE_LOCALES, 1)[0]) + # The transliteration of arabic names introduces non-alphabetic + # characgters that don't work with the draft author extraction code, and + # also don't seem to match the way people with arabic names romanize them. + locales = set( [ l for l in faker.config.AVAILABLE_LOCALES if not l.startswith('ar_') ] ) + return faker.Faker(random.sample(locales, 1)[0]) class UserFactory(factory.DjangoModelFactory): class Meta: