Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_settings: Flush cache after commiting changes to DB.

Sahil Batra0ea5daece879
diff --git a/zerver/actions/user_settings.py b/zerver/actions/user_settings.py
index 2e1a3a9fb29..334806d1d28 100644
--- a/zerver/actions/user_settings.py
+++ b/zerver/actions/user_settings.py
@@ -472,6 +472,8 @@ def do_change_user_setting(
assert isinstance(setting_value, str)
event["language_name"] = get_language_name(setting_value)
+ transaction.on_commit(lambda: flush_user_profile(sender=UserProfile, instance=user_profile))
+
send_event_on_commit(user_profile.realm, event, [user_profile.id])
if setting_name in {"web_font_size_px", "web_line_height_percent"}:
@@ -545,8 +547,6 @@ def do_change_user_setting(
user_profile.email = get_display_email_address(user_profile)
user_profile.save(update_fields=["email"])
- transaction.on_commit(lambda: flush_user_profile(sender=UserProfile, instance=user_profile))
-
send_user_email_update_event(user_profile)
notify_avatar_url_change(user_profile)