mirror of https://github.com/zulip/zulip.git
refactor: Make acting_user a mandatory kwarg for do_set_realm_authentication_methods.
This commit is contained in:
parent
c95061e9b9
commit
4dc62f962b
|
@ -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))
|
||||
|
|
|
@ -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()):
|
||||
|
|
|
@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue