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_topics: Rename the 'zerver/lib/user_topics' functions.

Prakhar Pratyush0b2fe5b1636b
diff --git a/zerver/lib/streams.py b/zerver/lib/streams.py
index c2d67d9e1ff..37a6bdbebb4 100644
--- a/zerver/lib/streams.py
+++ b/zerver/lib/streams.py
@@ -491,7 +491,7 @@ def access_web_public_stream(stream_id: int, realm: Realm) -> Stream:
return stream
-def access_stream_for_unmute_topic_by_name(
+def access_stream_to_remove_visibility_policy_by_name(
user_profile: UserProfile, stream_name: str, error: str
) -> Stream:
"""
@@ -514,7 +514,7 @@ def access_stream_for_unmute_topic_by_name(
return stream
-def access_stream_for_unmute_topic_by_id(
+def access_stream_to_remove_visibility_policy_by_id(
user_profile: UserProfile, stream_id: int, error: str
) -> Stream:
try:
diff --git a/zerver/views/user_topics.py b/zerver/views/user_topics.py
index cdca5ce59d0..d86393c5126 100644
--- a/zerver/views/user_topics.py
+++ b/zerver/views/user_topics.py
@@ -11,8 +11,8 @@ from zerver.lib.response import json_success
from zerver.lib.streams import (
access_stream_by_id,
access_stream_by_name,
- access_stream_for_unmute_topic_by_id,
- access_stream_for_unmute_topic_by_name,
+ access_stream_to_remove_visibility_policy_by_id,
+ access_stream_to_remove_visibility_policy_by_name,
check_for_exactly_one_stream_arg,
)
from zerver.lib.validator import check_int, check_string_in
@@ -50,10 +50,10 @@ def unmute_topic(
error = _("Topic is not muted")
if stream_name is not None:
- stream = access_stream_for_unmute_topic_by_name(user_profile, stream_name, error)
+ stream = access_stream_to_remove_visibility_policy_by_name(user_profile, stream_name, error)
else:
assert stream_id is not None
- stream = access_stream_for_unmute_topic_by_id(user_profile, stream_id, error)
+ stream = access_stream_to_remove_visibility_policy_by_id(user_profile, stream_id, error)
do_set_user_topic_visibility_policy(
user_profile, stream, topic_name, visibility_policy=UserTopic.VisibilityPolicy.INHERIT