'Returns the default URL for a particular user.
This method can be used to customize where a user is sent when
they log in, etc. By default it returns the value of
:meth:`get_absolute_url`.
An alternative function can be supplied to customize this behavior
by specifying a either a URL or a function which returns a URL via
the ``"user_home"`` key in ``HORIZON_CONFIG``. Each of these
would be valid::
{"user_home": "/home",}  # A URL
{"user_home": "my_module.get_user_home",}  # Path to a function
{"user_home": lambda user: "/" + user.name,}  # A function
{"user_home": None,}  # Will always return the default dashboard
This can be useful if the default dashboard may not be accessible
to all users. When user_home is missing from HORIZON_CONFIG,
it will default to the settings.LOGIN_REDIRECT_URL value.'

def get_user_home(self, user):

    user_home = self._conf['user_home']
    if user_home:
        if callable(user_home):
            return user_home(user)
        elif isinstance(user_home, six.string_types):
            if ('/' in user_home):
                return user_home
            else:
                (mod, func) = user_home.rsplit('.', 1)
                return getattr(import_module(mod), func)(user)
        raise ValueError('The    user_home    setting    must    be    either    a    string    or    a    callable    object    (e.g.    a    function).')
    else:
        return self.get_absolute_url()
