mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
models: Add Stream.history_public_to_subscribers.
This commit adds a new field history_public_to_subscribers to the Stream model, which serves a similar function to the old settings.PRIVATE_STREAM_HISTORY_FOR_SUBSCRIBERS; we still use that setting as the default value for new streams to avoid breaking backwards-compatibility for those users before we are ready with an actual UI for users to choose directly. This also comes with a migration to set the value of the new field for existing streams with an algorithm matching that used at runtime. With significant changes by Tim Abbott. This is an initial part of our efforts on #9232.
This commit is contained in:
@@ -525,7 +525,8 @@ class ZulipTestCase(TestCase):
|
||||
return open(fn).read()
|
||||
|
||||
def make_stream(self, stream_name: Text, realm: Optional[Realm]=None,
|
||||
invite_only: Optional[bool]=False) -> Stream:
|
||||
invite_only: Optional[bool]=False,
|
||||
history_public_to_subscribers: Optional[bool]=False) -> Stream:
|
||||
if realm is None:
|
||||
realm = self.DEFAULT_REALM
|
||||
|
||||
@@ -534,6 +535,7 @@ class ZulipTestCase(TestCase):
|
||||
realm=realm,
|
||||
name=stream_name,
|
||||
invite_only=invite_only,
|
||||
history_public_to_subscribers=history_public_to_subscribers,
|
||||
)
|
||||
except IntegrityError: # nocoverage -- this is for bugs in the tests
|
||||
raise Exception('''
|
||||
|
||||
Reference in New Issue
Block a user