Exemplo n.º 1
0
def restore_news(id):
	id = int(id)

	data.update_article(id, state="editing")
	return json.dumps({'success': True}), 200, {'ContentType': 'application/json'}
Exemplo n.º 2
0
def publish_news(id):
	id = int(id)

	data.update_article(id, state="published")
	return json.dumps({'success': True}), 200, {'ContentType': 'application/json'}
Exemplo n.º 3
0
def update_article(id):
	if current_user.is_authenticated:
		data.update_article(id, request.form)
		return "ok"
	else:
		abort(401)