From 1d44fd724bc38791d003f2bfa99aae88bcc1ef33 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 8 May 2019 15:04:31 -0700 Subject: [PATCH] audit log: Log which server admin deactivated a realm too. --- analytics/tests/test_views.py | 2 +- analytics/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/analytics/tests/test_views.py b/analytics/tests/test_views.py index a666567e57..8b678c9caf 100644 --- a/analytics/tests/test_views.py +++ b/analytics/tests/test_views.py @@ -437,7 +437,7 @@ class TestSupportEndpoint(ZulipTestCase): with mock.patch("analytics.views.do_deactivate_realm") as m: result = self.client_post("/activity/support", {"realm_id": "3", "status": "deactivated"}) - m.assert_called_once_with(get_realm("lear")) + m.assert_called_once_with(get_realm("lear"), self.example_user("iago")) self.assert_in_success_response(["Lear & Co. deactivated"], result) with mock.patch("analytics.views.do_reactivate_realm") as m: diff --git a/analytics/views.py b/analytics/views.py index 052db488da..66ebba9494 100644 --- a/analytics/views.py +++ b/analytics/views.py @@ -1060,7 +1060,7 @@ def support(request: HttpRequest) -> HttpResponse: do_reactivate_realm(realm) context["message"] = "{} reactivated.".format(realm.name) elif status == "deactivated": - do_deactivate_realm(realm) + do_deactivate_realm(realm, request.user) context["message"] = "{} deactivated.".format(realm.name) scrub_realm = request.POST.get("scrub_realm", None)