示例#1
0
 def delete_session(account):
     """ Delete the session assiociated with that account. """
     try:
         session = AccountSession.get(AccountSession.account == account)
         session.delete_instance()
     except AccountSession.DoesNotExist:
         LOG.warning("Tried to delete an non-existing session.")
示例#2
0
 def delete_session(account):
     """ Delete the session assiociated with that account. """
     try:
         session = AccountSession.get(AccountSession.account == account)
         session.delete_instance()
     except AccountSession.DoesNotExist:
         LOG.warning("Tried to delete an non-existing session.")
示例#3
0
    def get_session(account_name):
        """ Return the session associated with the account with that name,
        or None if no session or account can be found. """
        account = AccountManager.get_account(account_name)
        if account is None:
            return None

        try:
            return AccountSession.get(AccountSession.account == account)
        except AccountSession.DoesNotExist:
            return None
示例#4
0
    def get_session(account_name):
        """ Return the session associated with the account with that name,
        or None if no session or account can be found. """
        account = AccountManager.get_account(account_name)
        if account is None:
            return None

        try:
            return AccountSession.get(AccountSession.account == account)
        except AccountSession.DoesNotExist:
            return None