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.

streams: Return archived web-public channels.

Sanchit Sharmad5c83e02c38b
diff --git a/zerver/lib/message.py b/zerver/lib/message.py
index 1d5d945f067..ab94407b2cc 100644
--- a/zerver/lib/message.py
+++ b/zerver/lib/message.py
@@ -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
diff --git a/zerver/lib/streams.py b/zerver/lib/streams.py
index 724caf17873..cae1d5456d3 100644
--- a/zerver/lib/streams.py
+++ b/zerver/lib/streams.py
@@ -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.
diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py
index 0c37631f14b..aa574dd3b26 100644
--- a/zerver/tests/test_message_edit.py
+++ b/zerver/tests/test_message_edit.py
@@ -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")