dev_ldap_directory: Use f-strings for better readability.

This commit is contained in:
Evgenii 2024-01-09 23:09:09 +03:00 committed by GitHub
parent 1a927c50b0
commit 3f06596cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -39,20 +39,20 @@ def generate_dev_ldap_dir(mode: str, num_users: int = 8) -> Dict[str, Dict[str,
"birthDate": [user_data[3]],
}
if mode == "a":
ldap_dir["uid=" + email + ",ou=users,dc=zulip,dc=com"] = dict(
ldap_dir[f"uid={email},ou=users,dc=zulip,dc=com"] = dict(
uid=[email],
thumbnailPhoto=[profile_images[i % len(profile_images)]],
userAccountControl=[LDAP_USER_ACCOUNT_CONTROL_NORMAL],
**common_data,
)
elif mode == "b":
ldap_dir["uid=" + email_username + ",ou=users,dc=zulip,dc=com"] = dict(
ldap_dir[f"uid={email_username},ou=users,dc=zulip,dc=com"] = dict(
uid=[email_username],
jpegPhoto=[profile_images[i % len(profile_images)]],
**common_data,
)
elif mode == "c":
ldap_dir["uid=" + email_username + ",ou=users,dc=zulip,dc=com"] = dict(
ldap_dir[f"uid={email_username},ou=users,dc=zulip,dc=com"] = dict(
uid=[email_username], email=[email], **common_data
)