Example #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.")
Example #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.")
Example #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
Example #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