diff --git a/docs/tutorials/new-feature-tutorial.md b/docs/tutorials/new-feature-tutorial.md index 7d68723ca5..94ca645890 100644 --- a/docs/tutorials/new-feature-tutorial.md +++ b/docs/tutorials/new-feature-tutorial.md @@ -321,7 +321,9 @@ field and send an event. For example: # zerver/lib/actions.py - def do_set_realm_authentication_methods(realm: Realm, authentication_methods: Dict[str, bool]) -> None: + def do_set_realm_authentication_methods( + realm: Realm, authentication_methods: Dict[str, bool], *, acting_user: Optional[UserProfile] + ) -> None: for key, value in list(authentication_methods.items()): index = getattr(realm.authentication_methods, key).number realm.authentication_methods.set_bit(index, int(value)) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index c74a7dbf90..0e8b6b0cc1 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -824,7 +824,7 @@ def do_set_realm_property( def do_set_realm_authentication_methods( - realm: Realm, authentication_methods: Dict[str, bool], acting_user: Optional[UserProfile] = None + realm: Realm, authentication_methods: Dict[str, bool], *, acting_user: Optional[UserProfile] ) -> None: old_value = realm.authentication_methods_dict() for key, value in list(authentication_methods.items()): diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 3737753267..a47b1b07e6 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -1068,7 +1068,7 @@ class NormalActionsTest(BaseAction): with fake_backends(): events = self.verify_action( lambda: do_set_realm_authentication_methods( - self.user_profile.realm, auth_method_dict + self.user_profile.realm, auth_method_dict, acting_user=None ) )