mirror of https://github.com/zulip/zulip.git
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.
This commit is contained in:
parent
bfc1e45a91
commit
b26b647b1d
|
@ -425,13 +425,31 @@ 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)
|
||||
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))
|
||||
|
|
Loading…
Reference in New Issue