streams: Return archived web-public channels.

This commit is contained in:
Sanchit Sharma
2025-04-11 09:27:48 +05:30
committed by Tim Abbott
parent 32e6383779
commit d5c83e02c3
3 changed files with 4 additions and 10 deletions

View File

@@ -480,7 +480,6 @@ def access_web_public_message(
# These should all have been enforced by the code in
# get_web_public_streams_queryset
assert stream.is_web_public
assert not stream.deactivated
assert not stream.invite_only
assert stream.history_public_to_subscribers

View File

@@ -870,11 +870,6 @@ def get_web_public_streams_queryset(realm: Realm) -> QuerySet[Stream]:
return Stream.objects.filter(
realm=realm,
is_web_public=True,
# In theory, nothing conflicts with allowing web-public access
# to deactivated streams. However, we should offer a way to
# review archived streams and adjust their settings before
# allowing that configuration to exist.
deactivated=False,
# In theory, is_web_public=True implies invite_only=False and
# history_public_to_subscribers=True, but it's safer to include
# these in the query.

View File

@@ -335,12 +335,12 @@ class EditMessageTest(ZulipTestCase):
result, "Not logged in: API authentication or user session required", 401
)
# Verify deactivated streams are rejected. This may change in the future.
# Verify success with deactivated streams.
do_deactivate_stream(web_public_stream, acting_user=None)
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
self.assert_json_error(
result, "Not logged in: API authentication or user session required", 401
)
response_dict = self.assert_json_success(result)
self.assertEqual(response_dict["raw_content"], "web-public message")
self.assertEqual(response_dict["message"]["flags"], ["read"])
def test_fetch_raw_message_stream_wrong_realm(self) -> None:
user_profile = self.example_user("hamlet")