def add_comment_to_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) comment = OfferComment.newComment(offer, user, comment_content) comment.save() notifyProgrammers_newoffercomment(comment) notifySponsors_newoffercomment(comment) return offer
def add_comment_to_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) offer.issue.touch() comment = OfferComment.newComment(offer, user, comment_content) comment.save() watches = watch_services.find_issue_and_offer_watches(comment.offer) notifyWatchers_newoffercomment(comment, watches) return offer
def revoke_existing_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) _throwIfNotOfferOwner(offer, user) _throwIfOfferNotOpen(offer, user, 'revoke offer') offer.revoke() comment = None if (comment_content): comment = OfferComment.newComment(offer, user, comment_content) comment.save() notifyProgrammers_offerrevoked(offer, comment) return offer
def revoke_existing_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) _throwIfNotOfferOwner(offer, user) _throwIfOfferNotOpen(offer, user, 'revoke offer') offer.revoke() comment = None if(comment_content): comment = OfferComment.newComment(offer, user, comment_content) comment.save() notifyProgrammers_offerrevoked(offer, comment) return offer
def revoke_existing_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) offer.issue.touch() _throwIfNotOfferOwner(offer, user) _throwIfOfferNotOpen(offer, user, 'revoke offer') offer.revoke() comment = None if(comment_content): comment = OfferComment.newComment(offer, user, comment_content) comment.save() watches = watch_services.find_issue_and_offer_watches(offer) notifyWatchers_offerrevoked(offer, comment, watches) return offer
def revoke_existing_offer(offer_id, comment_content, user): offer = Offer.objects.get(pk=offer_id) offer.issue.touch() _throwIfNotOfferOwner(offer, user) _throwIfOfferNotOpen(offer, user, 'revoke offer') offer.revoke() comment = None if (comment_content): comment = OfferComment.newComment(offer, user, comment_content) comment.save() watches = watch_services.find_issue_and_offer_watches(offer) notifyWatchers_offerrevoked(offer, comment, watches) return offer