diff options
author | Zuul <zuul@review.opendev.org> | 2019-12-21 05:54:24 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-12-21 05:54:24 +0000 |
commit | 780dd0f9e84015de021318296c9c25070ecbb72d (patch) | |
tree | 3262e8da9796b57d3f14d6b1ece2429ee4622e6d | |
parent | 1f1ac980ef9ee288a2e8ff27fba2e80cdb12d611 (diff) | |
parent | f6490abc288f667e9af299264e5eebf7eb931355 (diff) | |
download | horizon-780dd0f9e84015de021318296c9c25070ecbb72d.tar.gz |
Merge "Fix users/projects list when domain context is changed" into stable/stein
-rw-r--r-- | openstack_dashboard/api/keystone.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index c2fdc51b2..65706bfbf 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -163,8 +163,12 @@ def keystoneclient(request, admin=False): token_id = user.token.id if is_multi_domain_enabled(): - # Cloud Admin, Domain Admin or Mixed Domain Admin - if is_domain_admin(request): + is_domain_context_specified = bool( + request.session.get("domain_context")) + + # If user is Cloud Admin, Domain Admin or Mixed Domain Admin and there + # is no domain context specified, use domain scoped token + if is_domain_admin(request) and not is_domain_context_specified: domain_token = request.session.get('domain_token') if domain_token: token_id = getattr(domain_token, 'auth_token', None) |