mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
streams: Return archived web-public channels.
(cherry picked from commit d5c83e02c3)
This commit is contained in:
committed by
Tim Abbott
parent
e6291a540c
commit
bcd88fdb68
@@ -480,7 +480,6 @@ def access_web_public_message(
|
|||||||
# These should all have been enforced by the code in
|
# These should all have been enforced by the code in
|
||||||
# get_web_public_streams_queryset
|
# get_web_public_streams_queryset
|
||||||
assert stream.is_web_public
|
assert stream.is_web_public
|
||||||
assert not stream.deactivated
|
|
||||||
assert not stream.invite_only
|
assert not stream.invite_only
|
||||||
assert stream.history_public_to_subscribers
|
assert stream.history_public_to_subscribers
|
||||||
|
|
||||||
|
|||||||
@@ -868,11 +868,6 @@ def get_web_public_streams_queryset(realm: Realm) -> QuerySet[Stream]:
|
|||||||
return Stream.objects.filter(
|
return Stream.objects.filter(
|
||||||
realm=realm,
|
realm=realm,
|
||||||
is_web_public=True,
|
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
|
# In theory, is_web_public=True implies invite_only=False and
|
||||||
# history_public_to_subscribers=True, but it's safer to include
|
# history_public_to_subscribers=True, but it's safer to include
|
||||||
# these in the query.
|
# these in the query.
|
||||||
|
|||||||
@@ -335,12 +335,12 @@ class EditMessageTest(ZulipTestCase):
|
|||||||
result, "Not logged in: API authentication or user session required", 401
|
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)
|
do_deactivate_stream(web_public_stream, acting_user=None)
|
||||||
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
|
result = self.client_get("/json/messages/" + str(web_public_stream_msg_id))
|
||||||
self.assert_json_error(
|
response_dict = self.assert_json_success(result)
|
||||||
result, "Not logged in: API authentication or user session required", 401
|
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:
|
def test_fetch_raw_message_stream_wrong_realm(self) -> None:
|
||||||
user_profile = self.example_user("hamlet")
|
user_profile = self.example_user("hamlet")
|
||||||
|
|||||||
Reference in New Issue
Block a user