Fix bug: TypeError in `register_user()` while using LDAP auth module.