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.

alert_words: Update remove_alert_word codepath to send event on commit.

Prakhar Pratyushdc27711399c7
diff --git a/zerver/actions/alert_words.py b/zerver/actions/alert_words.py
index f21b2737469..4a0430ae819 100644
--- a/zerver/actions/alert_words.py
+++ b/zerver/actions/alert_words.py
@@ -18,6 +18,7 @@ def do_add_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) ->
notify_alert_words(user_profile, words)
[email protected](savepoint=False)
def do_remove_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) -> None:
words = remove_user_alert_words(user_profile, alert_words)
notify_alert_words(user_profile, words)
diff --git a/zerver/lib/alert_words.py b/zerver/lib/alert_words.py
index a5d686c654f..b955f7cac9f 100644
--- a/zerver/lib/alert_words.py
+++ b/zerver/lib/alert_words.py
@@ -72,7 +72,7 @@ def add_user_alert_words(user_profile: UserProfile, new_words: Iterable[str]) ->
return user_alert_words(user_profile)
[email protected](savepoint=False)
def remove_user_alert_words(user_profile: UserProfile, delete_words: Iterable[str]) -> list[str]:
# TODO: Ideally, this would be a bulk query, but Django doesn't have a `__iexact`.
# We can clean this up if/when PostgreSQL has more native support for case-insensitive fields.