From c26d928eb07b8464112cab7d473532de0e8d578a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 22 Nov 2020 23:40:49 +0100 Subject: [PATCH] core: make impersonation's redirect return to shell --- passbook/core/tests/test_impersonation.py | 4 ++-- passbook/core/views/impersonate.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/passbook/core/tests/test_impersonation.py b/passbook/core/tests/test_impersonation.py index d88bbbad8..a7bdc26ec 100644 --- a/passbook/core/tests/test_impersonation.py +++ b/passbook/core/tests/test_impersonation.py @@ -23,7 +23,7 @@ class TestImpersonation(TestCase): ) ) - response = self.client.get(reverse("passbook_core:overview")) + response = self.client.get(reverse("passbook_api:user-me")) self.assertIn(self.other_user.username, response.content.decode()) self.assertNotIn(self.pbadmin.username, response.content.decode()) @@ -52,4 +52,4 @@ class TestImpersonation(TestCase): self.client.force_login(self.other_user) response = self.client.get(reverse("passbook_core:impersonate-end")) - self.assertRedirects(response, reverse("passbook_core:overview")) + self.assertRedirects(response, reverse("passbook_core:shell")) diff --git a/passbook/core/views/impersonate.py b/passbook/core/views/impersonate.py index a2e9dd09f..4c6d5a523 100644 --- a/passbook/core/views/impersonate.py +++ b/passbook/core/views/impersonate.py @@ -33,7 +33,7 @@ class ImpersonateInitView(View): Event.new(EventAction.IMPERSONATION_STARTED).from_http(request, user_to_be) - return redirect("passbook_core:overview") + return redirect("passbook_core:shell") class ImpersonateEndView(View): @@ -46,7 +46,7 @@ class ImpersonateEndView(View): or SESSION_IMPERSONATE_ORIGINAL_USER not in request.session ): LOGGER.debug("Can't end impersonation", user=request.user) - return redirect("passbook_core:overview") + return redirect("passbook_core:shell") original_user = request.session[SESSION_IMPERSONATE_ORIGINAL_USER] @@ -55,4 +55,4 @@ class ImpersonateEndView(View): Event.new(EventAction.IMPERSONATION_ENDED).from_http(request, original_user) - return redirect("passbook_core:overview") + return redirect("passbook_core:shell")