Custom screen name with LDAP login
I deployed Askbot and set up LDAP login and it works very well. For consistency with other applications in our company, the user ID/login is the email address.
However, I would like to automatically set a better screen name for my users (based on their first+last name or the first half of their email address). The main reason I want to set this screen name automatically is that @mentions do not work with email addresses.
I tried to update the screen name at the end of the
ldap_create_user_default() method with the following code (taken from
edit_user()), but it did not work.
new_username = user.first_name + " " + user.last_name group = user.get_personal_group() user.username = new_username group.name = format_personal_group_name(user) group.save() user.save()