From b26b647b1d971719d6970a12e3103a1278346dcb Mon Sep 17 00:00:00 2001 From: Arun Sankar Date: Wed, 31 Mar 2021 19:22:53 +0530 Subject: [PATCH] populate_db: Add non ASCII and non BMP characters to usernames. Added non ASCII and non bmp characters to full name. Created a new list for non_ascii_names and emojis to store them explicitly. A full name will now consist of first name + (a non ASCII name or a plain middle name) + (a emoji or a plain last name). First name will not have any non ASCII or non bmp text as it is also being used as email. --- zilencer/management/commands/populate_db.py | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 6a6c41c9e2..7e8594bf08 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -425,14 +425,32 @@ class Command(BaseCommand): "Towns", "Wall", ] + non_ascii_names = [ + "Günter", + "أحمد", + "Magnús", + "आशी", + "イツキ", + "语嫣", + "அருண்", + "Александр", + "José", + ] + # to imitate emoji insertions in usernames + raw_emojis = ["😎", "😂", "🐱‍👤"] for i in range(num_boring_names, num_names): fname = random.choice(fnames) + str(i) full_name = fname if random.random() < 0.7: - if random.random() < 0.5: + if random.random() < 0.3: + full_name += " " + random.choice(non_ascii_names) + else: full_name += " " + random.choice(mnames) - full_name += " " + random.choice(lnames) + if random.random() < 0.1: + full_name += " {} ".format(random.choice(raw_emojis)) + else: + full_name += " " + random.choice(lnames) email = fname.lower() + "@zulip.com" names.append((full_name, email))