def delete_news(news_id): if 'username' not in session: return redirect( '/login' ) # if user is not logged in, user will get redirected to /login nm = NewsModel(db.get_connection()) nm.delete(news_id) return redirect("/index")
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")
def delete_news(news_id): nm = NewsModel(db.get_connection()) nm.delete(news_id) return redirect("/news_list")