Skip to content
Snippets Groups Projects
Commit 00e462bc authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Fix display name in syncusers command

JIRA INFRA-2909
parent 084e53c3
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,9 @@ def sync_user(connection, user): ...@@ -54,7 +54,9 @@ def sync_user(connection, user):
disable_user(user) disable_user(user)
else: else:
attributes = ldap_user["attributes"] attributes = ldap_user["attributes"]
user.display_name = utils.attribute_to_string(attributes["cn"]) user.display_name = (
utils.attribute_to_string(attributes["cn"]) or user.username
)
user.email = utils.attribute_to_string(attributes["mail"]) user.email = utils.attribute_to_string(attributes["mail"])
groups = ldap_manager.get_user_groups( groups = ldap_manager.get_user_groups(
dn=ldap3.utils.conv.escape_filter_chars(ldap_user["dn"]), dn=ldap3.utils.conv.escape_filter_chars(ldap_user["dn"]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment