def gen_post_status():

    if not app.config["DEBUG"]:
        post_status = and_(Post.status == PostStatus.PUBLISH)
    else:
        post_status = or_(Post.status == PostStatus.PUBLISH,
                          Post.status == PostStatus.DRAFT)
    return post_status
Show only published posts outside debug.
dataset/ETHPy150Open marteinn/AtomicPress/atomicpress/themes/minimal/helpers.py/gen_post_status