Last name validation error for users with single word full name

Summary

The regular sign up form accepts only full name. There is a getter set for first_name and last_name in GL.com: https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/user.rb#L915

However, if a user enters only single word in full_name, for e.g. full_name = Aishwarya, then the getter method for last_name would return an empty string: https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/user.rb#L921

If this user tries to apply trial using the new trial sign in flow, the user would get the error Last name can't be blank.

This happens as Last name is mandatory in Customer model.

last-name-bug

Solution

User profile settings Suggested update
screenshot-2019-12-17-08-51-19 screenshot-2019-12-16-15-04-52

Steps to reproduce

  1. Sign up using regular sign up, enter only single word for full_name
  2. Sign out
  3. Use same account to sign in using Trial sign in flow - <app-url>/-/trial_registrations/new
  4. Enter Company details, click Submit
  5. The form throws error: Last name can't be blank
  6. User has no way to enter Last name

What is the expected correct behavior?

Find an appropriate way to fill in last_name, when full name was previously entered as a single word.

Examples

Internal links:

  • https://gitlab.zendesk.com/agent/tickets/141477
Edited Dec 17, 2019 by Alper Akgun
Assignee Loading
Time tracking Loading