mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
do_deactivate_realm: Add deactivation_reason kwarg.
It's going to be helpful in the future to record the reason for realm deactivation. - For information tracking - For making a distinction between cases where we can allow realm owners to reactivate their realm via a self-serve flow (e.g. "owner_request") vs where we can't (ToS abuse).
This commit is contained in:
committed by
Tim Abbott
parent
6af748fa77
commit
27c4e46b30
@@ -421,11 +421,15 @@ class TestRealmAuditLog(ZulipTestCase):
|
||||
def test_realm_activation(self) -> None:
|
||||
realm = get_realm("zulip")
|
||||
user = self.example_user("desdemona")
|
||||
do_deactivate_realm(realm, acting_user=user)
|
||||
do_deactivate_realm(realm, acting_user=user, deactivation_reason="owner_request")
|
||||
log_entry = RealmAuditLog.objects.get(
|
||||
realm=realm, event_type=RealmAuditLog.REALM_DEACTIVATED, acting_user=user
|
||||
)
|
||||
extra_data = log_entry.extra_data
|
||||
|
||||
deactivation_reason = extra_data["deactivation_reason"]
|
||||
self.assertEqual(deactivation_reason, "owner_request")
|
||||
|
||||
self.check_role_count_schema(extra_data[RealmAuditLog.ROLE_COUNT])
|
||||
|
||||
do_reactivate_realm(realm)
|
||||
|
||||
Reference in New Issue
Block a user