Do not redirect to the /identity tab admin users on login.

The /identity url may have more resources than project page so it loads slowly.
We can improve user experience by setting different login url.

Change-Id: I6ce91974d101d80e9685826dc4e6a6495e6a5da3
Closes-Bug: #1778006
This commit is contained in:
Ivan Kolodyazhny 2018-06-21 11:19:33 +03:00
parent 0bfe3e3de4
commit 9b6b559eca
2 changed files with 7 additions and 16 deletions

View File

@ -25,7 +25,6 @@ from django.views.generic import TemplateView
from six.moves import urllib
import horizon
from horizon import base
from horizon import exceptions
from horizon import notifications
@ -36,21 +35,7 @@ MESSAGES_PATH = getattr(settings, 'MESSAGES_PATH', None)
def get_user_home(user):
try:
token = user.token
except AttributeError:
raise exceptions.NotAuthenticated()
# Domain Admin, Project Admin will default to identity
dashboard = None
if token.project.get('id') is None or user.is_superuser:
try:
dashboard = horizon.get_dashboard('identity')
except base.NotRegistered:
pass
if dashboard is None:
dashboard = horizon.get_default_dashboard()
dashboard = horizon.get_default_dashboard()
return dashboard.get_absolute_url()

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Do not redirect to the /identity tab admin users on login. Now `user_home`
config options works in the same way for all users.
[`bug/1778006 <https://bugs.launchpad.net/horizon/1778006>`_]