diff options
author | Marek <marek.lycka@ultimum.io> | 2019-09-20 09:46:03 +0200 |
---|---|---|
committer | Georgina Shippey <georgina.shippey@bbc.co.uk> | 2020-03-25 11:29:26 +0000 |
commit | a1afb5046721ab57fc0af9d62400c4a21647e1f4 (patch) | |
tree | 1a605480bbfa8d5b4bc3499d014b7a465fc501d5 | |
parent | e058e381607e93439a59f47c36e6a9b7cf61cc71 (diff) | |
download | horizon-a1afb5046721ab57fc0af9d62400c4a21647e1f4.tar.gz |
Forwards LOGOUT_URL to templates.
Uses the openstack context preprocessor to pass
the LOGOUT_URL from settings to templates and
changes the 'Sign out' menu entry to redirect to it
instead of the logout view directly.
closes-bug: #1747149
Change-Id: Id17ffca6b5e24779433c3f19d009bb2a77f7b901
(cherry picked from commit a11aa7ff62c15d7bf15367106f933ef0ae5d4521)
-rw-r--r-- | openstack_dashboard/context_processors.py | 1 | ||||
-rw-r--r-- | openstack_dashboard/templates/header/_user_menu.html | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/openstack_dashboard/context_processors.py b/openstack_dashboard/context_processors.py index 676e335e2..faf5afbd2 100644 --- a/openstack_dashboard/context_processors.py +++ b/openstack_dashboard/context_processors.py @@ -87,6 +87,7 @@ def openstack(request): context['WEBROOT'] = settings.WEBROOT context['USER_MENU_LINKS'] = settings.USER_MENU_LINKS + context['LOGOUT_URL'] = settings.LOGOUT_URL # Adding profiler support flag profiler_settings = settings.OPENSTACK_PROFILER diff --git a/openstack_dashboard/templates/header/_user_menu.html b/openstack_dashboard/templates/header/_user_menu.html index 66c0cacc7..6cc26ca8c 100644 --- a/openstack_dashboard/templates/header/_user_menu.html +++ b/openstack_dashboard/templates/header/_user_menu.html @@ -59,7 +59,7 @@ {% endif %} <li class="divider"></li> <li> - <a href="{% url 'logout' %}" target="_self"> + <a href="{{ LOGOUT_URL }}" target="_self"> <span class="fa fa-sign-out"></span> {% trans "Sign Out" %} </a> |