diff --git a/HISTORY.rst b/HISTORY.rst index 33455a562d..1658428ce3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -89,6 +89,7 @@ * Add MERCs 5 and 6. * Update authentication function views to use Django's new class based authentication views. +* Expose Django's LOGOUT_REDIRECT_URL setting. 3.1.11 (2019-04-XX) =================== diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 86a0b7abea..9023b76c2c 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -121,6 +121,7 @@ Other changes * Add MERCs 5 and 6. * Update authentication function views to use Django's new class based authentication views. +* Expose Django's LOGOUT_REDIRECT_URL setting. Removals -------- diff --git a/mayan/apps/common/settings.py b/mayan/apps/common/settings.py index c972c02f39..209498b713 100644 --- a/mayan/apps/common/settings.py +++ b/mayan/apps/common/settings.py @@ -296,6 +296,19 @@ setting_django_login_redirect_url = namespace.add_setting( 'have to define the URL in two places (settings and URLconf).' ), ) +setting_django_logout_redirect_url = namespace.add_setting( + global_name='LOGOUT_REDIRECT_URL', + default=settings.LOGOUT_REDIRECT_URL, + help_text=_( + 'Default: None. The URL where requests are redirected after a user ' + 'logs out using LogoutView (if the view doesn\'t get a next_page ' + 'argument). If None, no redirect will be performed and the logout ' + 'view will be rendered. This setting also accepts named URL ' + 'patterns which can be used to reduce configuration duplication ' + 'since you don\'t have to define the URL in two places (settings ' + 'and URLconf).' + ) +) setting_django_internal_ips = namespace.add_setting( global_name='INTERNAL_IPS', default=settings.INTERNAL_IPS, diff --git a/mayan/settings/base.py b/mayan/settings/base.py index 6bd97a72ef..e28eac9247 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -253,6 +253,9 @@ TEST_RUNNER = 'mayan.apps.common.tests.runner.MayanTestRunner' LOGIN_URL = env('MAYAN_LOGIN_URL', default='authentication:login_view') LOGIN_REDIRECT_URL = env('MAYAN_LOGIN_REDIRECT_URL', default='common:root') +LOGOUT_REDIRECT_URL = env( + 'MAYAN_LOGOUT_REDIRECT_URL', default='authentication:login_view' +) INTERNAL_IPS = ('127.0.0.1',) # ---------- Django REST framework -----------