Пример #1
0
    def select_board_by_uri(self, uri):
        """Selected a board by URI

        In:
          - ``uri`` -- the uri of the board
        """
        if not uri:
            return
        board = self.boards_manager.get_by_uri(uri)
        if board is not None and not board.archived:
            self._select_board(board)
        else:
            raise exceptions.BoardNotFound()
Пример #2
0
    def select_board(self, id_):
        """Selected a board by id

        In:
          - ``id_`` -- the id of the board
        """
        if not id_:
            return
        board = self.boards_manager.get_by_id(id_)
        if board is not None and not board.archived:
            self._select_board(board)
            self.selected = 'board'
        else:
            raise exceptions.BoardNotFound()
Пример #3
0
    def select_board(self, id_):
        """Redirect to a board by id

        In:
          - ``id_`` -- the id of the board
        """
        if not id_:
            return
        board = self.boards_manager.get_by_id(id_)
        if board is not None and not board.archived:
            self.content.becomes(board, 'redirect')
            self.selected = 'board'
        else:
            raise exceptions.BoardNotFound()