Add error handling for when LDAP "Full Name Attribute" has no white space.

Review Request #9211 - Created Sept. 23, 2017 and updated

Riley Creaghan
Review Board
release-2.5.x
4489
3096001...
reviewboard, students

When setting up LDAP authentication, an uncaught exception may be thrown
when splitting the full name into first name and last name. This happens
when the full name contains no space.

If this exception occurs it will now assign the full name to the first
name, and make the last name an empty string.
Because there was a comment just above my changes explaining how full
name is split between first and last name, I added to it to explain what
happens to first and last name in this situation.

I was not able to properly reproduce and test this manually because I
could not get a LDAP server up and running.

I have written a unit test that provides the modified function,
get_or_create_user(), with a user that has a full name containing no
spaces and verifies that the first and last name are assigned as
expected.
This test passes with this fix, and fails on 2.5.x without the fix.

  • 0
  • 0
  • 5
  • 0
  • 5
Description From Last Updated
Christian Hammond
Riley Creaghan
Riley Creaghan
Riley Creaghan
Riley Creaghan
David Trowbridge
Riley Creaghan
Review request changed

Commit:

-cdc046c877250b13e1e52d8ffb2e567968ac385f
+30960013268239b57d8747ece940fab4a13bf3fe

Diff:

Revision 5 (+53 -1)

Show changes

Checks run (2 succeeded)

JSHint passed.
flake8 passed.
Barret Rennie
  1. Ship It!
  2. 
      
Loading...