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

Models: fix username case-insensitive comparator & release: v5.0.1 #476

Merged

Conversation

ptamarit
Copy link
Member

Fixes https://github.com/zenodo/ops/issues/326

❤️ Thank you for your contribution!

Description

Usernames are enforced to be unique in the DB regardless of their case (see related DB column and constraint definition).

This change proposes to compare usernames case-insensitively.
This will avoid problems like users trying to sign up with an existing username but with a different case, which are currently hitting the DB constraint and then showing an nginx 502 error since it is not well handled by Flask.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Third-party code

If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

invenio_accounts/models.py Show resolved Hide resolved
invenio_accounts/models.py Show resolved Hide resolved
tests/test_models.py Show resolved Hide resolved
@ptamarit ptamarit force-pushed the username-case-insensitive-comparator branch from bc4f819 to 1d68326 Compare March 22, 2024 13:48
@ptamarit ptamarit changed the title Models: fix username case-insensitive comparator & release: v4.0.3 Models: fix username case-insensitive comparator & release: v5.0.1 Mar 22, 2024
@slint slint merged commit 345abfc into inveniosoftware:master Mar 27, 2024
8 checks passed
@ptamarit ptamarit deleted the username-case-insensitive-comparator branch March 28, 2024 07:33
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