mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 02:53:52 +00:00
audit_log: Log RealmAuditLog in do_set_realm_property.
Log RealmAuditLog in do_set_realm_property and do_remove_realm_domain. Tests for the changes are written in test_events because it will save duplicate code for test_change_realm_property.
This commit is contained in:
@@ -293,9 +293,10 @@ active users in a realm.
|
||||
|
||||
# zerver/lib/actions.py
|
||||
|
||||
def do_set_realm_property(realm: Realm, name: str, value: bool) -> None:
|
||||
"""Takes in a realm object, the name of an attribute to update, and the
|
||||
value to update.
|
||||
def do_set_realm_property(realm: Realm, name: str, value: bool,
|
||||
acting_user: Optional[UserProfile]=None) -> None:
|
||||
"""Takes in a realm object, the name of an attribute to update, the
|
||||
value to update and and the user who initiated the update.
|
||||
"""
|
||||
property_type = Realm.property_types[name]
|
||||
assert isinstance(value, property_type), (
|
||||
|
||||
@@ -266,7 +266,7 @@ def update_realm(
|
||||
):
|
||||
realm = user_profile.realm
|
||||
# ...
|
||||
do_set_realm_property(realm, k, v)
|
||||
do_set_realm_property(realm, k, v, acting_user=user_profile)
|
||||
# ...
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user