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

Fix for #244 #245

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix for #244 #245

wants to merge 2 commits into from

Conversation

73VW
Copy link

@73VW 73VW commented Jan 30, 2024

Hello @mostafa,

Here's a starting point for a fix for #244.

I am not really sure how I should implement a test for this nor if this is the best way to implement it.

Tell me what do you think about this.

Cheers!

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Mael Pedretti seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the no-pr-activity Stale action label Mar 16, 2024
Copy link

This PR was closed because it has been stalled for 10 days with no activity.

Copy link
Member

@mostafa mostafa left a comment

Choose a reason for hiding this comment

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

Hey @73VW,

Thanks for your contribution! Please fix the tests and address the comment.

django_saml2_auth/user.py Outdated Show resolved Hide resolved
Co-authored-by: Mostafa Moradian <[email protected]>
@73VW
Copy link
Author

73VW commented Mar 27, 2024

Hello @mostafa,

Thank you for your reply!

This is a breaking change and I don't know if you want to merge it as is because backwards compatibility won't be ensured. Is that fine for you?

@mostafa mostafa added the work-in-progress Stale action label Apr 1, 2024
@ben-qr
Copy link

ben-qr commented May 2, 2024

@mostafa Is it possible to progress this PR? It's causing issues in ours repos that implement the package as we're not passing email as username, so would be great to be able to have this in a new version as soon as possible.
If backwards compatibility is a concern, seems to me that the PR simply needs to pass email as a kwarg when calling create_new_user. My proposal is the only change required to fix the issue is, on line 121:

email = user.get(user_model.EMAIL_FIELD)
kwargs = {"email": email} if email else {}
target_user = create_new_user(user_id, user["first_name"], user["last_name"], **kwargs)

I believe this will be backwards compatible.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress Stale action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto created users are missing email when using 'email' as USERNAME_FIELD and are not able to login afterwards
4 participants