def do_create_default_stream_group(realm: Realm, group_name: str, description: str, streams: List[Stream]) -> None:
    default_streams = get_default_streams_for_realm(realm.id)
    for stream in streams:
        if (stream in default_streams):
            raise JsonableError(_("'{stream_name}' is a default stream and cannot be added to '{group_name}'").format(stream_name=stream.name, group_name=group_name))
    check_default_stream_group_name(group_name)
    (group, created) = DefaultStreamGroup.objects.get_or_create(name=group_name, realm=realm, description=description)
    if (not created):
        raise JsonableError(_("Default stream group '{group_name}' already exists").format(group_name=group_name))
    group.streams.set(streams)
    notify_default_stream_groups(realm)
def do_create_default_stream_group(realm: Realm, group_name: str, description: str, streams: List[Stream]) -> None:
    default_streams = get_default_streams_for_realm(realm.id)
    for stream in streams:
        if (stream in default_streams):
            raise JsonableError(_("'{stream_name}' is a default stream and cannot be added to '{group_name}'").format(stream_name=stream.name, group_name=group_name))
    check_default_stream_group_name(group_name)
    (group, created) = DefaultStreamGroup.objects.get_or_create(name=group_name, realm=realm, description=description)
    if (not created):
        raise JsonableError(_("Default stream group '{group_name}' already exists").format(group_name=group_name))
    group.streams.set(streams)
    notify_default_stream_groups(realm)