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_sending_stream.

shanukun8f70386df383
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 675850684eb..49d0e223e0c 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -4114,7 +4114,7 @@ def do_change_plan_type(
def do_change_default_sending_stream(
- user_profile: UserProfile, stream: Optional[Stream], acting_user: Optional[UserProfile] = None
+ user_profile: UserProfile, stream: Optional[Stream], *, acting_user: Optional[UserProfile]
) -> None:
old_value = user_profile.default_sending_stream_id
user_profile.default_sending_stream = stream
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index c85907b8c3c..825c4796f4f 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -1462,11 +1462,11 @@ class NormalActionsTest(BaseAction):
bot = self.create_bot("test")
stream = get_stream("Rome", bot.realm)
- action = lambda: do_change_default_sending_stream(bot, stream)
+ action = lambda: do_change_default_sending_stream(bot, stream, acting_user=None)
events = self.verify_action(action)
check_realm_bot_update("events[0]", events[0], "default_sending_stream")
- action = lambda: do_change_default_sending_stream(bot, None)
+ action = lambda: do_change_default_sending_stream(bot, None, acting_user=None)
events = self.verify_action(action)
check_realm_bot_update("events[0]", events[0], "default_sending_stream")