Skip to content

Commit

Permalink
Don't change dashboard on admin tenant switch
Browse files Browse the repository at this point in the history
Switching projects as an admin user currently dumps you back to
the Admin dashboard tab. This change fixes that by adding a 'next'
parameter to the switching URL that points to the default panel
of the current dashboard.

The redirect is to the default panel rather than the current one,
since the next tenant may not have access to the current panel
and we want to avoid kicking a user back to the login screen.

Fixes bug #1072848.

Change-Id: I25b8c0e38945d5db57f5bfe7bb174cdbd66156d5
  • Loading branch information
spearki committed Mar 6, 2013
1 parent f754398 commit 6db859c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion horizon/templates/horizon/common/_sidebar.html
Expand Up @@ -22,7 +22,7 @@ <h3>{{ request.user.tenant_name }}</h3>
<li class='divider'></li>
{% for tenant in authorized_tenants %}
{% if tenant.enabled and tenant.id != request.user.tenant_id %}
<li><a href="{% url switch_tenants tenant.id %}">{{ tenant.name }}</a></li>
<li><a href="{% url switch_tenants tenant.id %}?next={{ request.horizon.dashboard.get_absolute_url }}">{{ tenant.name }}</a></li>
{% endif %}
{% endfor %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Expand Up @@ -6,7 +6,7 @@ set -o errexit
# Increment me any time the environment should be rebuilt.
# This includes dependncy changes, directory renames, etc.
# Simple integer secuence: 1, 2, 3...
environment_version=29
environment_version=30
#--------------------------------------------------------#

function usage {
Expand Down
2 changes: 1 addition & 1 deletion tools/pip-requires
@@ -1,7 +1,7 @@
# Horizon Core Requirements
Django>=1.4,<1.5
django_compressor
django_openstack_auth>=1.0.3
django_openstack_auth>=1.0.7
netaddr
python-cinderclient
python-glanceclient<2
Expand Down

0 comments on commit 6db859c

Please sign in to comment.