Beispiel #1
0
def delete_news():
    if not current_user.is_admin and not current_user.is_coach:
        return redirect(url_for('main.index'))
    try:
        news_id = request.form.get('news_id')
        news_server.delete_by_id(news_id)
        return u'OK'
    except Exception, e:
        print e.message
        return u'FAIL'
Beispiel #2
0
def delete_news():
    if not current_user.is_admin and not current_user.is_coach:
        return redirect(url_for('main.index'))
    try:
        news_id = request.form.get('news_id')
        news_server.delete_by_id(news_id)
        return u'OK'
    except Exception, e:
        current_app.logger.error(traceback.format_exc())
        return u'FAIL'