actions: Refactor functions for stream permission changes.

do_make_stream_web_public and do_change_stream_invite_only seem
to contain very similar logic that could just live inside the
do_change_stream_permission function that handles all permission
changes in one place.
This commit is contained in:
Eeshan Garg
2021-12-08 18:38:08 -05:00
committed by Tim Abbott
parent f0ee065292
commit fab1b7f5d5
6 changed files with 61 additions and 75 deletions

View File

@@ -325,7 +325,10 @@ def update_stream_backend(
if is_private is not None or is_web_public is not None:
do_change_stream_permission(
stream, is_private, history_public_to_subscribers, is_web_public
stream,
invite_only=is_private,
history_public_to_subscribers=history_public_to_subscribers,
is_web_public=is_web_public,
)
return json_success()