예제 #1
0
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'))
예제 #2
0
def admin():
	if not helper.getCurrentUser():
		return redirect(url_for('index'))
	return render_template('adminpage.html')