Skip to content

Commit

Permalink
ldap: workaround for the first name change update
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Jun 16, 2024
1 parent b610339 commit 2d5867f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cds_ils/ldap/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ def __init__(self, remote_account):

def _get_full_user_info(self):
"""Serialize data from user db models."""
last_name, first_name = self.user_profile.full_name.split(",")
# workaround for the first update to <SURNAME, given names> format
# without this the update comparison fails
if "," in self.user_profile.full_name:
last_name, first_name = self.user_profile.full_name.split(",")
else:
last_name = self.user_profile.full_name
first_name = ""
user_info = dict(
user_profile_first_name=first_name.strip(),
user_profile_last_name=last_name.strip(),
Expand Down

0 comments on commit 2d5867f

Please sign in to comment.