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