mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Fix changing email addresses back after email change.
We apparently were not correctly clearing the user_profile's email address from caches when changing email addresses, which meant that trying to look up the old email in the user_profile caches would still work. Fixes #6035.
This commit is contained in:
@@ -16,6 +16,7 @@ from zerver.lib.bugdown import (
|
||||
url_embed_preview_enabled_for_realm
|
||||
)
|
||||
from zerver.lib.cache import (
|
||||
delete_user_profile_caches,
|
||||
to_dict_cache_key,
|
||||
to_dict_cache_key_id,
|
||||
)
|
||||
@@ -616,6 +617,8 @@ def do_deactivate_stream(stream, log=True):
|
||||
|
||||
def do_change_user_email(user_profile, new_email):
|
||||
# type: (UserProfile, Text) -> None
|
||||
delete_user_profile_caches([user_profile])
|
||||
|
||||
user_profile.email = new_email
|
||||
user_profile.save(update_fields=["email"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user