Skip to content
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

Allow case-renaming Users #2073

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Allow case-renaming Users #2073

merged 2 commits into from
Feb 12, 2025

Conversation

Masterjun3
Copy link
Collaborator

Before this, we couldn't rename users from "CoolDude" into "cooldude" because we did the check case insensitively. If we carelessly allowed it, then someone could be renamed into "Adelikat" when "adelikat" already exists.

This PR changes this so that both cases are now properly handled. The critical line is
.Where(userName => userName == oldUserName || userName == newUserName)
We ourselves don't check anything with letter case, and instead we let the DB do everything. We use it to check for both the old user name and the new one, and if the DB finds 2 different people, then we can't rename.

Also there are unit tests. :D

@adelikat adelikat merged commit 573c20c into main Feb 12, 2025
1 check passed
@adelikat adelikat deleted the allow-case-renaming-users branch February 12, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants