예제 #1
0
def verify_token(token):
    """ Verify whether a token is correct by trying to get a list of a user's boards """
    trello = TrelloClient(constants.KEY, token)
    try:
        trello.list_boards()
    except Unauthorized:
        return False
    return True
예제 #2
0
def find_boards(user):
    """ Retrieves a  user's boards """
    trello = TrelloClient(constants.KEY, user.auth_token)
    boards = trello.list_boards()
    board_info = {}
    for board in boards:
        if board.closed is False:
            board_info[board.id] = board.name
    return board_info