예제 #1
0
파일: general.py 프로젝트: missundaztood/fc
def report(id):
    r = reports.find_by_id(id)
    if not r:
        abort(404)
    recent_reports = reports.recent()
    return render_template('report.html', report=r,
            recent_reports=recent_reports)
예제 #2
0
파일: general.py 프로젝트: missundaztood/fc
def edit_report(id=None):
    r = reports.find_by_id(id) if id is not None else None
    if r and not r.can_edit_by(g.user):
        abort(403)

    if request.method == 'GET':
        return render_template('report_edit.html', report=r)

    # post
    action = request.form['action']
    if action == u'投稿':
        return post_report(r)
    elif action == u'削除':
        return delete_report(r)
    abort(400)