def delete_news(news_id): if 'username' not in session: return redirect('/login') nm = NewsModel(db.get_connection()) print(news_id, 'jj') nm.delete(news_id) return redirect("/admin")
def delete_news(news_id): if 'username' not in session: return redirect('/ban') nm = NewsModel(news_db.get_connection()) nm.delete(news_id) cm = CommentsModel(comments_db.get_connection()) cm.news_delete(news_id) return redirect("/index")
def delete_news(news_id): news = NewsModel(db.get_connection()) if not news.get(news_id): return jsonify({'error': 'Not found'}) news.delete(news_id) return jsonify({'success': 'OK'})
def delete_news(news_id): if 'username' not in session: return redirect('/login') nm = NewsModel(db.get_connection()) nm.delete(news_id) return redirect("/index")