mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
Add logout redirect url
This commit is contained in:
@@ -227,6 +227,7 @@ AUTHENTICATION_BACKENDS = (
|
|||||||
)
|
)
|
||||||
LOGIN_REDIRECT_URL = '/profile/'
|
LOGIN_REDIRECT_URL = '/profile/'
|
||||||
LOGIN_URL = SITE_ROOT + 'accounts/login'
|
LOGIN_URL = SITE_ROOT + 'accounts/login'
|
||||||
|
LOGOUT_REDIRECT_URL = None
|
||||||
|
|
||||||
ACCOUNT_ACTIVATION_DAYS = 7
|
ACCOUNT_ACTIVATION_DAYS = 7
|
||||||
|
|
||||||
|
0
tests/seahub/auth/views/__init__.py
Normal file
0
tests/seahub/auth/views/__init__.py
Normal file
11
tests/seahub/auth/views/test_logout.py
Normal file
11
tests/seahub/auth/views/test_logout.py
Normal file
@@ -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')
|
@@ -70,7 +70,8 @@ else:
|
|||||||
name='auth_login'),
|
name='auth_login'),
|
||||||
url(r'^logout/$',
|
url(r'^logout/$',
|
||||||
auth_views.logout,
|
auth_views.logout,
|
||||||
{'template_name': 'registration/logout.html'},
|
{'template_name': 'registration/logout.html',
|
||||||
|
'next_page': settings.LOGOUT_REDIRECT_URL},
|
||||||
name='auth_logout'),
|
name='auth_logout'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user