diff --git a/seahub/settings.py b/seahub/settings.py index f30ffadf95..9689b5121f 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -227,6 +227,7 @@ AUTHENTICATION_BACKENDS = ( ) LOGIN_REDIRECT_URL = '/profile/' LOGIN_URL = SITE_ROOT + 'accounts/login' +LOGOUT_REDIRECT_URL = None ACCOUNT_ACTIVATION_DAYS = 7 diff --git a/tests/seahub/auth/views/__init__.py b/tests/seahub/auth/views/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/seahub/auth/views/test_logout.py b/tests/seahub/auth/views/test_logout.py new file mode 100644 index 0000000000..fcdb19c828 --- /dev/null +++ b/tests/seahub/auth/views/test_logout.py @@ -0,0 +1,11 @@ +from django.core.urlresolvers import reverse + +from seahub.test_utils import BaseTestCase + + +class LogoutTest(BaseTestCase): + def test_can_logout(self): + resp = self.client.get(reverse('auth_logout')) + + self.assertEqual(200, resp.status_code) + self.assertContains(resp, 'Log in again') diff --git a/thirdpart/registration/auth_urls.py b/thirdpart/registration/auth_urls.py index 93a1f26bc4..91664d356a 100644 --- a/thirdpart/registration/auth_urls.py +++ b/thirdpart/registration/auth_urls.py @@ -70,7 +70,8 @@ else: name='auth_login'), url(r'^logout/$', auth_views.logout, - {'template_name': 'registration/logout.html'}, + {'template_name': 'registration/logout.html', + 'next_page': settings.LOGOUT_REDIRECT_URL}, name='auth_logout'), )