def do_change_default_stream_group_name(realm: Realm, group: DefaultStreamGroup, new_group_name: str) -> None:
    if (group.name == new_group_name):
        raise JsonableError(_("This default stream group is already named '{}'").format(new_group_name))
    if DefaultStreamGroup.objects.filter(name=new_group_name, realm=realm).exists():
        raise JsonableError(_("Default stream group '{}' already exists").format(new_group_name))
    group.name = new_group_name
    group.save()
    notify_default_stream_groups(realm)
def do_change_default_stream_group_name(realm: Realm, group: DefaultStreamGroup, new_group_name: str) -> None:
    if (group.name == new_group_name):
        raise JsonableError(_("This default stream group is already named '{}'").format(new_group_name))
    if DefaultStreamGroup.objects.filter(name=new_group_name, realm=realm).exists():
        raise JsonableError(_("Default stream group '{}' already exists").format(new_group_name))
    group.name = new_group_name
    group.save()
    notify_default_stream_groups(realm)