WIP: Use the user model as the email model.#353
Open
jonathan-s wants to merge 1 commit intopinax:masterfrom
Open
WIP: Use the user model as the email model.#353jonathan-s wants to merge 1 commit intopinax:masterfrom
jonathan-s wants to merge 1 commit intopinax:masterfrom
Conversation
You can customize the user model so that the email is the username, in cases like that it may be superflouous to have multiple emails, in fact it may not be desirable. For applications like that it's easier to only use the email address defined in the user model.
4db2242 to
6736b71
Compare
jonathan-s
commented
Jul 12, 2021
| reverse(settings.ACCOUNT_EMAIL_CONFIRMATION_URL, args=[self.key]) | ||
| ) | ||
|
|
||
| user = self.email_address.user if not user_as_email() else self |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| user = self.email_address.user if not user_as_email() else self | |
| user = self.email_address.user if not user_as_email() else self.email_address |
jonathan-s
commented
Jul 12, 2021
| email_address = self.create(user=user, email=email, **kwargs) | ||
| if confirm and not email_address.verified: | ||
| email_address.send_confirmation() | ||
| self.send_confirmation(email=email) |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| self.send_confirmation(email=email) | |
| self.send_confirmation(email=email_address) |
Contributor
|
Not quite following this one but it is a pretty big change in how we consider email addresses with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can customize the user model so that the email
is the username, in cases like that it may be superflouous
to have multiple emails, in fact it may not be desirable.
For applications like that it's easier to only use the email
address defined in the user model.
Closes #347.