示例#1
0
def delete_comment_score(ctx: rest.Context,
                         params: Dict[str, str]) -> rest.Response:
    auth.verify_privilege(ctx.user, 'comments:score')
    comment = _get_comment(params)
    scores.delete_score(comment, ctx.user)
    ctx.session.commit()
    return _serialize(ctx, comment)
示例#2
0
def delete_post_score(ctx: rest.Context, params: Dict[str,
                                                      str]) -> rest.Response:
    auth.verify_privilege(ctx.user, 'posts:score')
    post = _get_post(params)
    scores.delete_score(post, ctx.user)
    ctx.session.commit()
    return _serialize_post(ctx, post)
示例#3
0
def delete_post_score(
        ctx: rest.Context, params: Dict[str, str]) -> rest.Response:
    auth.verify_privilege(ctx.user, 'posts:score')
    post = _get_post(params)
    scores.delete_score(post, ctx.user)
    ctx.session.commit()
    return _serialize_post(ctx, post)
示例#4
0
def delete_comment_score(
        ctx: rest.Context, params: Dict[str, str]) -> rest.Response:
    auth.verify_privilege(ctx.user, 'comments:score')
    comment = _get_comment(params)
    scores.delete_score(comment, ctx.user)
    ctx.session.commit()
    return _serialize(ctx, comment)
示例#5
0
 def delete(self, ctx, comment_id):
     auth.verify_privilege(ctx.user, 'comments:score')
     comment = comments.get_comment_by_id(comment_id)
     scores.delete_score(comment, ctx.user)
     ctx.session.commit()
     return comments.serialize_comment_with_details(comment, ctx.user)
示例#6
0
 def delete(self, ctx, comment_id):
     auth.verify_privilege(ctx.user, 'comments:score')
     comment = comments.get_comment_by_id(comment_id)
     scores.delete_score(comment, ctx.user)
     ctx.session.commit()
     return comments.serialize_comment_with_details(comment, ctx.user)
示例#7
0
def delete_post_score(ctx, params):
    auth.verify_privilege(ctx.user, 'posts:score')
    post = posts.get_post_by_id(params['post_id'])
    scores.delete_score(post, ctx.user)
    ctx.session.commit()
    return _serialize_post(ctx, post)
示例#8
0
 def delete(self, ctx, post_id):
     auth.verify_privilege(ctx.user, 'posts:score')
     post = posts.get_post_by_id(post_id)
     scores.delete_score(post, ctx.user)
     ctx.session.commit()
     return posts.serialize_post_with_details(post, ctx.user)
示例#9
0
def delete_comment_score(ctx, params):
    auth.verify_privilege(ctx.user, 'comments:score')
    comment = comments.get_comment_by_id(params['comment_id'])
    scores.delete_score(comment, ctx.user)
    ctx.session.commit()
    return _serialize(ctx, comment)
示例#10
0
 def delete(self, ctx, post_id):
     auth.verify_privilege(ctx.user, 'posts:score')
     post = posts.get_post_by_id(post_id)
     scores.delete_score(post, ctx.user)
     ctx.session.commit()
     return posts.serialize_post_with_details(post, ctx.user)