@read_session
def get_default_account(identity, type, session=None):
    '\n    Retrieves the default account mapped to an identity.\n\n    :param identity: The identity key name. For example, x509DN, or a username.\n    :param type: The type of the authentication (x509, gss, userpass, saml).\n    :param session: The database session to use.\n    :returns: The default account name, None otherwise.\n    '
    tmp = session.query(models.IdentityAccountAssociation).filter_by(identity=identity, identity_type=type, is_default=True).first()
    if (tmp is None):
        raise exception.IdentityError(('There is no default account for identity (%s, %s)' % (identity, type)))
    return tmp.account
Retrieves the default account mapped to an identity.

:param identity: The identity key name. For example, x509DN, or a username.
:param type: The type of the authentication (x509, gss, userpass, saml).
:param session: The database session to use.
:returns: The default account name, None otherwise.
@read_session
def get_default_account(identity, type, session=None):
    '\n    Retrieves the default account mapped to an identity.\n\n    :param identity: The identity key name. For example, x509DN, or a username.\n    :param type: The type of the authentication (x509, gss, userpass, saml).\n    :param session: The database session to use.\n    :returns: The default account name, None otherwise.\n    '
    tmp = session.query(models.IdentityAccountAssociation).filter_by(identity=identity, identity_type=type, is_default=True).first()
    if (tmp is None):
        raise exception.IdentityError(('There is no default account for identity (%s, %s)' % (identity, type)))
    return tmp.account