-
Notifications
You must be signed in to change notification settings - Fork 699
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 import duplicate usernames #11899
Fix import duplicate usernames #11899
Conversation
Release v0.16.x
Release v0.16.x
Build Artifacts
|
@nick2432 We'll proceed with the manual QA, please try to fix the linting errors in the meantime. |
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.
Hi @nick2432, there's one more case to handle here - if the username is already existing in the facility and I attempt to import several duplicated usernames or just the same username as the one which is already in the facility, you are now checking that they are duplicated but you are still allowing one of the usernames to be imported:
2024-02-19_11-19-23.mp4
It shouldn't be possible to import a duplicated username which is without a UUID.
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.
Please be sure to let us know how we can help in case you encounter any challenges while reverting the changes. Thanks |
89a62ac
to
9969834
Compare
Retargeting this to release-v0.16.x as the issue is for Planned Patch 1. |
Hi @nick2432 - sorry, after you sorted out your previous rebase woes, the retarget is going to give you more issues. Could you please rebase this onto release-v0.16.x? See here for instructions: https://github.com/learningequality/kolibri/blob/develop/docs/howtos/rebasing_a_pull_request.md |
41143b2
to
7b08d47
Compare
Hey @pcenov , could you please check my new changes? |
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.
Thanks @nick2432 - I confirm that now it's not possible to import duplicate usernames.
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.
Hi @nick2432. This looks correct to me. It would however be nice to add some tests to https://github.com/learningequality/kolibri/blob/7fba0d2a8edd9e2edda5df9ae196865a8c624172/kolibri/core/auth/test/test_bulk_import.py as as well covering the scenarios that @pcenov raised. Thanks again
I will add the tests and have resolved the scenarios raised by @pcenov. |
Thanks @nick2432. |
Also worth noting that there is a test failure now of an existing test, might be worth checking if something has broken, or if an assumption of the test is now being violated:
|
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.
LGTM. Thanks for seeing this through @nick2432.
Assigning this to Marcella for merge purposes. |
c2d3ece
into
learningequality:release-v0.16.x
Summary
This pull request introduces a modification to the get_username method, enabling case-insensitive checking for duplicate usernames.
Changes made
Updated the get_username method to convert usernames to lowercase before checking for duplicates.
Ensured that usernames with different letter cases are treated as the same to prevent case-related duplicates.
Issue Resolved
Fixes #11890
##Screenshots
2024-02-18.17-00-56.mp4