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

Bug fix: admin users with duplicate email #445

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

JenySadadia
Copy link
Collaborator

@JenySadadia JenySadadia commented Dec 29, 2023

Fixes #444
Created on top of #436

Staging has multiple users with the same email address. Fix the bug in admin user setup script.

Copy link
Member

@nuclearcat nuclearcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, staging seems works fine

@nuclearcat
Copy link
Member

It looks like it need rebase now?

The script is allowing multiple users with the
same email address. Fix the issue by creating
unique DB index on `User.email` field.
Remove manual check for existing `username`.
Catch `DuplicateKeyError` from `pymongo` while
creating users for duplicate username or
email field.

Signed-off-by: Jeny Sadadia <[email protected]>
@JenySadadia
Copy link
Collaborator Author

@nuclearcat Could you please update email of staging.kernelci.org or admin user on staging as both have the same emails?

@nuclearcat
Copy link
Member

Done, but i set non-existing email for admin. I guess it's ok for now, for staging

@JenySadadia
Copy link
Collaborator Author

Done, but i set non-existing email for admin. I guess it's ok for now, for staging

Yes, it will work for now.

@JenySadadia JenySadadia added this pull request to the merge queue Jan 9, 2024
Merged via the queue into kernelci:main with commit 8876165 Jan 9, 2024
4 checks passed
@JenySadadia JenySadadia deleted the fix-duplicate-email branch January 9, 2024 12:08
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.

pymongo.errors.DuplicateKeyError on api startup
2 participants