populate_db: Fix initialization of history_public_to_subscribers.

This was being incorrectly not initialized properly in the test suite,
because we neglected to update the bulk_create code path for creating
streams.
This commit is contained in:
Tim Abbott
2018-05-02 08:46:18 -07:00
parent 866cb38270
commit 4df886f36f
2 changed files with 8 additions and 1 deletions

View File

@@ -65,11 +65,17 @@ def bulk_create_streams(realm: Realm,
.values_list('name', flat=True)])
streams_to_create = [] # type: List[Stream]
for name, options in stream_dict.items():
if 'history_public_to_subscribers' not in options:
options['history_public_to_subscribers'] = (
not options["invite_only"] and not realm.is_zephyr_mirror_realm)
if name.lower() not in existing_streams:
streams_to_create.append(
Stream(
realm=realm, name=name, description=options["description"],
realm=realm,
name=name,
description=options["description"],
invite_only=options["invite_only"],
history_public_to_subscribers=options["history_public_to_subscribers"],
is_in_zephyr_realm=realm.is_zephyr_mirror_realm,
)
)