def addpost(): if helper.getCurrentUser(): if request.method == 'POST': articlename = request.form['articlename'] articlecontent = request.form['articlecontent'] postid = controller.storePost(articlename, articlecontent) return redirect('/postdetail/%s' % postid) return render_template('addpost.html', post_handle_url=url_for('addpost')) else: return redirect(url_for('login'))
def admin(): if not helper.getCurrentUser(): return redirect(url_for('index')) return render_template('adminpage.html')