def METHOD_NAME(jobpost_id):
    with app.test_request_context():
        post = JobPost.query.options(
            sa.orm.joinedload(JobPost.locations), sa.orm.joinedload(JobPost.taglinks)
        ).get(jobpost_id)
        # Find all boards that match and that don't have an all-match criteria
        query = Board.query.join(BoardAutoDomain).filter(
            BoardAutoDomain.domain == post.email_domain
        )
        query = query.union(
            Board.query.join(board_auto_jobtype_table).filter(
                board_auto_jobtype_table.c.jobtype_id == post.type_id
            )
        )
        query = query.union(
            Board.query.join(board_auto_jobcategory_table).filter(
                board_auto_jobcategory_table.c.jobcategory_id == post.category_id
            )
        )
        if post.geonameids:
            query = query.union(
                Board.query.join(BoardAutoLocation).filter(
                    BoardAutoLocation.geonameid.in_(post.geonameids)
                )
            )
        if post.taglinks:
            query = query.union(
                Board.query.join(board_auto_tag_table).filter(
                    board_auto_tag_table.c.tag_id.in_(
                        [
                            tl.tag_id
                            for tl in post.taglinks
                            if tl.status in TAG_TYPE.TAG_PRESENT
                        ]
                    )
                )
            )
        for board in query:
            # Some criteria match. Does this board require all to match?
            if not board.auto_all:
                # No? Add it
                board.add(post)
            else:
                # Yes? Check all the filters again
                if board.auto_domains and post.email_domain not in board.auto_domains:
                    # This board requires specific domains and none match. Skip.
                    continue
                if board.auto_locations:
                    if not set(board.auto_geonameids).intersection(
                        set(post.geonameids)
                    ):
                        # This board requires specific locations and none match. Skip.
                        continue
                if board.auto_tags:
                    if not set(board.auto_keywords).intersection(
                        {
                            tl.tag
                            for tl in post.taglinks
                            if tl.status in TAG_TYPE.TAG_PRESENT
                        }
                    ):
                        # This board requires specific keywords and none match. Skip.
                        continue
                if board.auto_types and post.type not in board.auto_types:
                    # This board requires specific job types and none match. Skip.
                    continue
                if board.auto_categories and post.category not in board.auto_categories:
                    # This board requires specific job categories and none match. Skip.
                    continue
                # No reason to exclude? Add it to the board
                board.add(post)
        db.session.commit()