From 1823d4623604879921b2a761b4e8313473258587 Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Tue, 7 Nov 2017 11:29:37 -0800 Subject: [PATCH] unsubscribe: Use a custom confirmation error page. Reverts a bit of 6e02ce8. --- zerver/tests/test_signup.py | 5 ++--- zerver/views/unsubscribe.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 7603c40dc3..ce5604113d 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -1107,10 +1107,9 @@ class EmailUnsubscribeTests(ZulipTestCase): def test_error_unsubscribe(self): # type: () -> None - # An invalid insubscribe token "test123" produces an error, in this - # case, a link malformed error. + # An invalid unsubscribe token "test123" produces an error. result = self.client_get('/accounts/unsubscribe/missed_messages/test123') - self.assert_in_response('Make sure you copied the link', result) + self.assert_in_response('Unknown email unsubscribe request', result) # An unknown message type "fake" produces an error. user_profile = self.example_user('hamlet') diff --git a/zerver/views/unsubscribe.py b/zerver/views/unsubscribe.py index 450964a2b5..218cbb7334 100644 --- a/zerver/views/unsubscribe.py +++ b/zerver/views/unsubscribe.py @@ -15,7 +15,7 @@ def process_unsubscribe(request: HttpRequest, confirmation_key: str, subscriptio try: user_profile = get_object_from_key(confirmation_key, Confirmation.UNSUBSCRIBE) except ConfirmationKeyException as exception: - return render_confirmation_key_error(request, exception) + return render(request, 'zerver/unsubscribe_link_error.html') unsubscribe_function(user_profile) context = common_context(user_profile)