populate_db: Use channel folder in dev database.

This commit creates "Engineering" channel folder and
adds "devel", "errors" and "test" channels to it.
This commit is contained in:
Sahil Batra
2025-06-10 15:46:45 +05:30
committed by Tim Abbott
parent 1e67b1d23f
commit e243fc67fa
2 changed files with 12 additions and 3 deletions

View File

@@ -221,6 +221,7 @@ def bulk_create_streams(realm: Realm, stream_dict: dict[str, dict[str, Any]]) ->
is_web_public=options.get("is_web_public", False), is_web_public=options.get("is_web_public", False),
is_in_zephyr_realm=realm.is_zephyr_mirror_realm, is_in_zephyr_realm=realm.is_zephyr_mirror_realm,
creator=options.get("creator", None), creator=options.get("creator", None),
folder_id=options.get("folder_id", None),
**get_default_values_for_stream_permission_group_settings(realm, creator), **get_default_values_for_stream_permission_group_settings(realm, creator),
) )
if "can_send_message_group" in options: if "can_send_message_group" in options:

View File

@@ -21,6 +21,7 @@ from django.utils.timezone import now as timezone_now
from typing_extensions import override from typing_extensions import override
from scripts.lib.zulip_tools import get_or_create_dev_uuid_var_path from scripts.lib.zulip_tools import get_or_create_dev_uuid_var_path
from zerver.actions.channel_folders import check_add_channel_folder
from zerver.actions.create_realm import do_create_realm from zerver.actions.create_realm import do_create_realm
from zerver.actions.custom_profile_fields import ( from zerver.actions.custom_profile_fields import (
do_update_user_custom_profile_data_if_changed, do_update_user_custom_profile_data_if_changed,
@@ -1037,8 +1038,15 @@ class Command(ZulipBaseCommand):
admins_system_group = NamedUserGroup.objects.get( admins_system_group = NamedUserGroup.objects.get(
name=SystemGroups.ADMINISTRATORS, realm=zulip_realm, is_system_group=True name=SystemGroups.ADMINISTRATORS, realm=zulip_realm, is_system_group=True
) )
channel_folder = check_add_channel_folder(
zulip_realm,
"Engineering",
"For convenient *channel folder* testing! :octopus:",
acting_user=iago,
)
zulip_stream_dict: dict[str, dict[str, Any]] = { zulip_stream_dict: dict[str, dict[str, Any]] = {
"devel": {"description": "For developing"}, "devel": {"description": "For developing", "folder_id": channel_folder.id},
# ビデオゲーム - VideoGames (japanese) # ビデオゲーム - VideoGames (japanese)
"ビデオゲーム": { "ビデオゲーム": {
"description": f"Share your favorite video games! {raw_emojis[2]}", "description": f"Share your favorite video games! {raw_emojis[2]}",
@@ -1051,8 +1059,8 @@ class Command(ZulipBaseCommand):
"design": {"description": "For design", "creator": hamlet}, "design": {"description": "For design", "creator": hamlet},
"support": {"description": "For support"}, "support": {"description": "For support"},
"social": {"description": "For socializing"}, "social": {"description": "For socializing"},
"test": {"description": "For testing `code`"}, "test": {"description": "For testing `code`", "folder_id": channel_folder.id},
"errors": {"description": "For errors"}, "errors": {"description": "For errors", "folder_id": channel_folder.id},
# 조리법 - Recipes (Korean), Пельмени - Dumplings (Russian) # 조리법 - Recipes (Korean), Пельмени - Dumplings (Russian)
"조리법 " + raw_emojis[0]: { "조리법 " + raw_emojis[0]: {
"description": "Everything cooking, from pasta to Пельмени" "description": "Everything cooking, from pasta to Пельмени"