Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)