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:
Mateusz Mandera
2024-05-19 01:30:36 +02:00
committed by Tim Abbott
parent 6af748fa77
commit 27c4e46b30
18 changed files with 103 additions and 35 deletions

View File

@@ -2932,7 +2932,7 @@ class NormalActionsTest(BaseAction):
# correct because were one to somehow compute page_params (as
# this test does), but that's not actually possible.
with self.verify_action(state_change_expected=False) as events:
do_deactivate_realm(realm, acting_user=None)
do_deactivate_realm(realm, acting_user=None, deactivation_reason="owner_request")
check_realm_deactivated("events[0]", events[0])
def test_do_mark_onboarding_step_as_read(self) -> None: