Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

refactor: Make acting_user a mandatory kwarg for do_change_default_all_public_streams.

shanukun0a214760045b
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index b5cbcb379ff..216d6f21649 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -4196,7 +4196,7 @@ def do_change_default_events_register_stream(
def do_change_default_all_public_streams(
- user_profile: UserProfile, value: bool, acting_user: Optional[UserProfile] = None
+ user_profile: UserProfile, value: bool, *, acting_user: Optional[UserProfile]
) -> None:
old_value = user_profile.default_all_public_streams
user_profile.default_all_public_streams = value
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index 2636b6039d4..172b51a528e 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -1454,7 +1454,7 @@ class NormalActionsTest(BaseAction):
def test_change_bot_default_all_public_streams(self) -> None:
bot = self.create_bot("test")
- action = lambda: do_change_default_all_public_streams(bot, True)
+ action = lambda: do_change_default_all_public_streams(bot, True, acting_user=None)
events = self.verify_action(action)
check_realm_bot_update("events[0]", events[0], "default_all_public_streams")