mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
do_set_realm_authentication_methods: Use transaction.atomic.
This commit is contained in:
committed by
Tim Abbott
parent
21ab5e3a55
commit
dc9aac9253
@@ -873,6 +873,7 @@ def do_set_realm_authentication_methods(
|
||||
realm: Realm, authentication_methods: Dict[str, bool], *, acting_user: Optional[UserProfile]
|
||||
) -> None:
|
||||
old_value = realm.authentication_methods_dict()
|
||||
with transaction.atomic():
|
||||
for key, value in list(authentication_methods.items()):
|
||||
index = getattr(realm.authentication_methods, key).number
|
||||
realm.authentication_methods.set_bit(index, int(value))
|
||||
@@ -891,6 +892,7 @@ def do_set_realm_authentication_methods(
|
||||
}
|
||||
).decode(),
|
||||
)
|
||||
|
||||
event = dict(
|
||||
type="realm",
|
||||
op="update_dict",
|
||||
|
||||
Reference in New Issue
Block a user