Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def delete_article():
  article = Article()
  url = request.args.get('URL')
  article.delete(url)
  return redirect('/blog', code=302)