コード例 #1
0
ファイル: views.py プロジェクト: chromakode/postcards
def publish():
    id = int(request.form['postcard-id'])
    postcard = Postcard._byID(id)
    if postcard.deleted or postcard.published:
        abort(403)
    postcard.published = True
    db.session.commit()

    generate_jsonp()
    submit_link_to_postcard(postcard.id)
    send_gold_claim_message(postcard.id)
    enflair_user(postcard.user)

    flash('postcard published!')
    return redirect('/')
コード例 #2
0
ファイル: views.py プロジェクト: chromakode/postcards
def publish():
    id = int(request.form['postcard-id'])
    postcard = Postcard._byID(id)
    if postcard.deleted or postcard.published:
        abort(403)
    postcard.published = True
    db.session.commit()

    generate_jsonp()
    submit_link_to_postcard(postcard.id)
    send_gold_claim_message(postcard.id)
    enflair_user(postcard.user)

    flash('postcard published!')
    return redirect('/')
コード例 #3
0
ファイル: views.py プロジェクト: MelissaCole/postcards
def publish(id):
    postcard = Postcard._byID(id)
    if postcard.deleted or postcard.published:
        abort(403)
    postcard.published = True
    db.session.commit()

    generate_jsonp()
    submit_link_to_postcard(postcard.id)
    send_gold_claim_message(postcard.id)
    enflair_user(postcard.user)

    if request.headers['X-Requested-With'] == 'XMLHttpRequest':
        return 'success!'
    else:
        flash('postcard published!')
        return redirect('/')
コード例 #4
0
def publish(id):
    postcard = Postcard._byID(id)
    if postcard.deleted or postcard.published:
        abort(403)
    postcard.published = True
    db.session.commit()

    generate_jsonp()
    submit_link_to_postcard(postcard.id)
    send_gold_claim_message(postcard.id)
    enflair_user(postcard.user)

    if request.headers['X-Requested-With'] == 'XMLHttpRequest':
        return 'success!'
    else:
        flash('postcard published!')
        return redirect('/')