development:misc:change_zulip_stream_type

Change Zulip stream type if there are no accessible members

root@zulip-fr01:~# sudo su - zulip
zulip@zulip-fr01:~$ cd deployments/
zulip@zulip-fr01:~/deployments$ cd current
zulip@zulip-fr01:~/deployments/current$ ./manage.py shell
In [1]: from zerver.models import get_realm
In [2]: from zerver.models import get_stream
In [3]: from zerver.models import get_user_by_delivery_email
In [4]: from zerver.actions.streams import do_change_stream_permission
In [5]: r = get_realm("")
In [6]: s = get_stream("stream-name", r)
In [7]: u = get_user_by_delivery_email("user@domain.com", r)
In [8]: do_change_stream_permission(s, invite_only=False, history_public_to_subscribers=True, is_web_public=False, acting_user=u)
  • development/misc/change_zulip_stream_type.txt
  • Last modified: 2024/03/15 19:43
  • by tplecko