'Populate the given profile object from AUTH_LDAP_PROFILE_ATTR_MAP.
Returns True if the profile was modified.'

def _populate_profile_from_attributes(self, profile):

    save_profile = False
    for (field, attr) in self.settings.PROFILE_ATTR_MAP.items():
        try:
            setattr(profile, field, self.attrs[attr][0])
            save_profile = True
        except Exception:
            logger.warning('%s    does    not    have    a    value    for    the    attribute    %s', self.dn, attr)
    return save_profile
