-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(UserRegistration): Allow spaces and - in first and last name #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality works well. I have a minor code refactor suggestion.
@@ -165,7 +165,7 @@ public class TeacherUserDetails extends PersistentUserDetails implements Mutable | |||
private String howDidYouHearAboutUs; | |||
|
|||
public String getCoreUsername() { | |||
return firstname + lastname; | |||
return firstname.replaceAll("[\\s-]+", "") + lastname.replaceAll("[\\s-]+", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can change this to just call replaceAll once.
return (firstname + lastname).replaceAll("[\\s-]+", "");
#183 # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch issue-183-update-account-validation # Your branch is up to date with 'origin/issue-183-update-account-validation'. # # Changes to be committed: # modified: src/main/java/org/wise/portal/domain/authentication/impl/TeacherUserDetails.java #
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
fix(UserRegistration): Allow spaces and - in first and last name (WISE-Community#192)
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
Test
Closes #183