Karaage-Cluster/karaage

Users with only one name will error when being added to ldap

Closed this issue · 2 comments

Because SN a required field.

FN, SN is basically the result of the fullname.split() So i guess one option is to set the first name and surname to the same value?

sn is initialized as:

luser.sn = person.last_name

Where last_name is

    def _get_last_name(self):
        warnings.warn('Person.last_name obsolete (get)', DeprecationWarning)
        if not self.full_name:
            return None
        elif self.full_name.find(" ") != -1:
            _, _, last_name = self.full_name.rpartition(" ")
            return last_name.strip()
        else:
            return None
    last_name = property(_get_last_name, _set_last_name)

The depreciated message needs to be fixed somehow. Unfortunately, LDAP seems to require givenName and SN, something I hadn't realized at the time. So LDAP is the only user of these functions that I know of, and the only reason I haven't deleted them.

I thought I had allowed for the case where there is only one name, but it looks like I return None, I should return self.full_name I guess.

Fixed in 0a3b4e5.