Exemplo n.º 1
0
def articles_append_tag(req, id, tag_id):
    check_login(req)
    match_right(req, module_rights)
    check_token(req, req.form.get('token'), uri='/admin/articles/%d' % id)

    article = Article(id)

    if not article.append_tag(req, tag_id):
        return send_json(req, {'reason': 'integrity_error'})
    req.content_type = 'application/json'
    return '{}'