mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +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]
|
realm: Realm, authentication_methods: Dict[str, bool], *, acting_user: Optional[UserProfile]
|
||||||
) -> None:
|
) -> None:
|
||||||
old_value = realm.authentication_methods_dict()
|
old_value = realm.authentication_methods_dict()
|
||||||
|
with transaction.atomic():
|
||||||
for key, value in list(authentication_methods.items()):
|
for key, value in list(authentication_methods.items()):
|
||||||
index = getattr(realm.authentication_methods, key).number
|
index = getattr(realm.authentication_methods, key).number
|
||||||
realm.authentication_methods.set_bit(index, int(value))
|
realm.authentication_methods.set_bit(index, int(value))
|
||||||
@@ -891,6 +892,7 @@ def do_set_realm_authentication_methods(
|
|||||||
}
|
}
|
||||||
).decode(),
|
).decode(),
|
||||||
)
|
)
|
||||||
|
|
||||||
event = dict(
|
event = dict(
|
||||||
type="realm",
|
type="realm",
|
||||||
op="update_dict",
|
op="update_dict",
|
||||||
|
|||||||
Reference in New Issue
Block a user