mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Access the UserProfile's new email field rather than using User.
This is preparatory for stopping using the User model. (imported from commit a1b0808c8cc2ddd19a25163f91c4f18620c9ce90)
This commit is contained in:
@@ -59,7 +59,7 @@ def bulk_create_users(realms, users_raw):
|
||||
profiles_by_email = {}
|
||||
profiles_by_id = {}
|
||||
for profile in UserProfile.objects.select_related().all():
|
||||
profiles_by_email[profile.user.email] = profile
|
||||
profiles_by_email[profile.email] = profile
|
||||
profiles_by_id[profile.id] = profile
|
||||
|
||||
recipients_to_create = []
|
||||
@@ -70,7 +70,7 @@ def bulk_create_users(realms, users_raw):
|
||||
|
||||
recipients_by_email = {}
|
||||
for recipient in Recipient.objects.filter(type=Recipient.PERSONAL):
|
||||
recipients_by_email[profiles_by_id[recipient.type_id].user.email] = recipient
|
||||
recipients_by_email[profiles_by_id[recipient.type_id].email] = recipient
|
||||
|
||||
subscriptions_to_create = []
|
||||
for (email, _, _, _) in users:
|
||||
|
||||
Reference in New Issue
Block a user