def set_featured_title():
"""Form POST to update featured title"""
title = request.form['title']
stack = request.form['stack']
article = models.search_for_article(title, stacks=[stack], status=PUBLISHED)
if article is None:
flash('Cannot find published guide "%s" stack "%s"' % (title, stack),
category='error')
url = session.pop('previously_requested_page', None)
if url is None:
url = url_for('index')
return redirect(url)
models.set_featured_article(article)
flash('Featured guide updated', category='info')
return redirect(url_for('index'))
评论列表
文章目录