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

shanukun00d998b955e0
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 7f0a948cc1b..7ad74aef59a 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -908,10 +908,7 @@ def do_set_realm_message_editing(
def do_set_realm_notifications_stream(
- realm: Realm,
- stream: Optional[Stream],
- stream_id: int,
- acting_user: Optional[UserProfile] = None,
+ realm: Realm, stream: Optional[Stream], stream_id: int, *, acting_user: Optional[UserProfile]
) -> None:
old_value = realm.notifications_stream_id
realm.notifications_stream = stream
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index d0bad290541..2c808431356 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -1152,7 +1152,10 @@ class NormalActionsTest(BaseAction):
for notifications_stream, notifications_stream_id in ((stream, stream.id), (None, -1)):
events = self.verify_action(
lambda: do_set_realm_notifications_stream(
- self.user_profile.realm, notifications_stream, notifications_stream_id
+ self.user_profile.realm,
+ notifications_stream,
+ notifications_stream_id,
+ acting_user=None,
)
)
check_realm_update("events[0]", events[0], "notifications_stream_id")