def remove_article(id): ''' Remote a specific article based on its ID. ''' username = request.headers.get('x-koala-username') apikey = request.headers.get('x-koala-key') user = locate_user(username, apikey) delete = Article.delete().where(Article.id == id) result = delete.execute() if result == 0: abort(404) else: return '', 200
def delete_article(): article = Article() url = request.args.get('URL') article.delete(url) return redirect('/blog', code=302)