From 39ce424fd5ed0b749e2943359a8cb7a6dc557ad9 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Thu, 2 Dec 2021 17:55:25 +0100 Subject: [PATCH] confirmation: Delete rendundant confirmation_link_expired_error page. This template provides nothing that link_expired.html does not and is redundant. --- .../zerver/confirmation_link_expired_error.html | 14 -------------- zerver/tests/test_signup.py | 6 ++++-- zerver/views/registration.py | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 templates/zerver/confirmation_link_expired_error.html diff --git a/templates/zerver/confirmation_link_expired_error.html b/templates/zerver/confirmation_link_expired_error.html deleted file mode 100644 index a423755f1f..0000000000 --- a/templates/zerver/confirmation_link_expired_error.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "zerver/portico_signup.html" %} - -{% block portico_content %} -
- -
-{% endblock %} diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index d019420948..a977f718f7 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -2115,7 +2115,7 @@ so we didn't send them an invitation. We did send invitations to everyone else!" """Since the key is a param input by the user to the registration endpoint, if it inserts an invalid value, the confirmation object won't be found. This tests if, in that scenario, we handle the exception by redirecting the user to - the confirmation_link_expired_error page. + the link_expired page. """ email = self.nonreg_email("alice") password = "password" @@ -3980,7 +3980,9 @@ class UserSignUpTest(InviteUserBase): ) # Error page should be displayed self.assertEqual(result.status_code, 404) - self.assert_in_response("The registration link has expired or is not valid.", result) + self.assert_in_response( + "Whoops. The confirmation link has expired or been deactivated.", result + ) def test_signup_with_multiple_default_stream_groups(self) -> None: # Check if user is subscribed to the streams of default diff --git a/zerver/views/registration.py b/zerver/views/registration.py index ea5edfd6c4..449d848566 100644 --- a/zerver/views/registration.py +++ b/zerver/views/registration.py @@ -132,7 +132,7 @@ def check_prereg_key( return render_confirmation_key_error(request, exception) if prereg_user.status == confirmation_settings.STATUS_REVOKED: - return render(request, "zerver/confirmation_link_expired_error.html", status=404) + return render(request, "confirmation/link_expired.html", status=404) return prereg_user