WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@jonathan-s
Copy link
Contributor

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.

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.
reverse(settings.ACCOUNT_EMAIL_CONFIRMATION_URL, args=[self.key])
)

user = self.email_address.user if not user_as_email() else self
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
self.send_confirmation(email=email)
self.send_confirmation(email=email_address)

@paltman
Copy link
Contributor

paltman commented Nov 24, 2021

Not quite following this one but it is a pretty big change in how we consider email addresses with EmailAddress model and email confirmations and having multiple addresses, etc. I need to come back to this and try to grok the rationale here.

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.

Introduce option to use User.email instead of EmailAddress

2 participants