mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
email: Convert accounts code to use delivery_email.
A key part of this is the new helper, get_user_by_delivery_email. Its verbose name is important for clarity; it should help avoid blind copy-pasting of get_user (which we'll also want to rename). Unfortunately, it requires detailed understanding of the context to figure out which one to use; each is used in about half of call sites. Another important note is that this PR doesn't migrate get_user calls in the tests except where not doing so would cause the tests to fail. This probably deserves a follow-up refactor to avoid bugs here.
This commit is contained in:
@@ -508,7 +508,7 @@ def enqueue_welcome_emails(user: UserProfile, realm_creation: bool=False) -> Non
|
||||
from_address = FromAddress.SUPPORT
|
||||
|
||||
other_account_count = UserProfile.objects.filter(
|
||||
email__iexact=user.email).exclude(id=user.id).count()
|
||||
delivery_email__iexact=user.delivery_email).exclude(id=user.id).count()
|
||||
unsubscribe_link = one_click_unsubscribe_link(user, "welcome")
|
||||
context = common_context(user)
|
||||
context.update({
|
||||
|
||||
Reference in New Issue
Block a user