From 5a4fb94be3df9577b259a875d3c0deb5dbe37435 Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Thu, 23 Aug 2012 15:03:13 -0400 Subject: [PATCH] Make confirm endpoint anonymous only and get rid of invalid test --- flask_security/views.py | 1 + tests/functional_tests.py | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/flask_security/views.py b/flask_security/views.py index aedc7b6..1d558db 100644 --- a/flask_security/views.py +++ b/flask_security/views.py @@ -170,6 +170,7 @@ def send_confirmation(): **_ctx('send_confirmation')) +@anonymous_user_required def confirm_email(token): """View function which handles a email confirmation request.""" after_this_request(_commit) diff --git a/tests/functional_tests.py b/tests/functional_tests.py index 9bb671c..4cd6c07 100644 --- a/tests/functional_tests.py +++ b/tests/functional_tests.py @@ -317,20 +317,6 @@ class ConfirmableTests(SecurityTest): msg = self.app.config['SECURITY_MSG_EMAIL_CONFIRMED'][0] self.assertIn(msg, r.data) - def test_confirm_email_twice_flashes_already_confirmed_message(self): - e = 'dude@lp.com' - - with capture_registrations() as registrations: - self.register(e) - token = registrations[0]['confirm_token'] - - url = '/confirm/' + token - self.client.get(url, follow_redirects=True) - r = self.client.get(url, follow_redirects=True) - - msg = self.app.config['SECURITY_MSG_ALREADY_CONFIRMED'][0] - self.assertIn(msg, r.data) - def test_invalid_token_when_confirming_email(self): r = self.client.get('/confirm/bogus', follow_redirects=True) self.assertIn('Invalid confirmation token', r.data)