예제 #1
0
파일: controllers.py 프로젝트: jietang/dbrc
def post_to_broadcast(broadcast_id):
    assert flask.request.method == 'POST', \
        'must use POST to publish things'
    try:
        data = flask.request.json
    except ValueError:
        # asserts cause a 400 to fire. this is a hack, but it's hack week.
        assert False, "'data' must be a valid JSON string"
    return {"screen_ids": model.publish(broadcast_id, data)}
예제 #2
0
def publish(id):
    # Publish an article, removing the 'draft' status
    article = model.get_article(id)
    if session['logged']:
        model.publish(article)
    return redirect(url_for('view_post', id=int(id)))
예제 #3
0
파일: blog.py 프로젝트: fsauch/SimpleBlog
def publish(id):
        # Publish an article, removing the 'draft' status
        article = model.get_article(id)
        if session['logged']:
                model.publish(article)
        return redirect(url_for('view_post', id=int(id)))