def comment(user, claim, text): if not can_comment(user, claim): raise PermissionDenied comment = Comment() comment.text = text comment.created_by = user comment.save() claim.comments.add(comment) return claim
def comment(user, bounty, text): if not can_comment(user, bounty): raise PermissionDenied comment = Comment() comment.text = text comment.created_by = user comment.save() bounty.comments.add(comment) return bounty