def add_comment_to_issue(issue_id, comment_content, user): issue = Issue.objects.get(pk=issue_id) comment = IssueComment.newComment(issue, user, comment_content) comment.save() notifyProgrammers_newissuecomment(comment) notifySponsors_newissuecomment(comment) return issue
def add_comment_to_issue(issue_id, comment_content, user): issue = Issue.objects.get(pk=issue_id) issue.touch() comment = IssueComment.newComment(issue, user, comment_content) comment.save() watches = watch_services.find_issue_watches(comment.issue) notifyWatchers_newissuecomment(comment, watches) return issue
def abort_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'abort solution') solution.abort() comment = None if(comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() notifySponsors_workstopped(solution, comment) return solution
def resolve_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'resolve solution') solution.resolve() comment = None if(comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() notifySponsors_workdone(solution, comment) notifyProgrammers_workdone(solution, comment) return solution
def resolve_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) solution.issue.touch() _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'resolve solution') solution.resolve() comment = None if(comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() watches = watch_services.find_issue_watches(solution.issue) notifyWatchers_workdone(solution, comment, watches) return solution
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 = IssueComment.newComment(offer.issue, user, comment_content) comment.save() watches = watch_services.find_issue_and_offer_watches(offer) notifyWatchers_offerrevoked(offer, comment, watches) return offer
def abort_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'abort solution') solution.abort() comment = None if (comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() notifySponsors_workstopped(solution, comment) return solution
def resolve_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'resolve solution') solution.resolve() comment = None if (comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() notifySponsors_workdone(solution, comment) notifyProgrammers_workdone(solution, comment) return solution
def resolve_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'resolve solution') solution.resolve() solution.issue.update_redundant_fields() comment = None if(comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() watches = watch_services.find_issue_and_project_watches(solution.issue) notifyWatchers_workdone(solution, comment, watches) return solution, comment
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() offer.issue.update_redundant_fields() comment = None if(comment_content): comment = IssueComment.newComment(offer.issue, user, comment_content) comment.save() watches = watch_services.find_issue_and_project_watches(offer.issue) notifyWatchers_offerrevoked(offer, comment, watches) return offer, comment
def abort_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'abort solution') solution.abort() solution.issue.update_redundant_fields(); comment = None if(comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() watches = watch_services.find_issue_and_project_watches(solution.issue) notifyWatchers_workstopped(solution, comment, watches) return solution, comment
def add_solution_to_existing_issue(issue_id, comment_content, user): issue = Issue.objects.get(pk=issue_id) solution = get_or_none(Solution, issue=issue, programmer=user) if (solution): _throwIfSolutionInProgress(solution, user, 'add solution') solution.reopen() else: solution = Solution.newSolution(issue, user) solution.save() comment = None if (comment_content): comment = IssueComment.newComment(issue, user, comment_content) comment.save() notifySponsors_workbegun(solution, comment) return issue
def abort_existing_solution(solution_id, comment_content, user): solution = Solution.objects.get(pk=solution_id) solution.issue.touch() _throwIfNotSolutionOwner(solution, user) _throwIfSolutionNotInProgress(solution, user, 'abort solution') solution.abort() comment = None if (comment_content): comment = IssueComment.newComment(solution.issue, user, comment_content) comment.save() watches = watch_services.find_issue_watches(solution.issue) notifyWatchers_workstopped(solution, comment, watches) return solution
def add_solution_to_existing_issue(issue_id, comment_content, user): issue = Issue.objects.get(pk=issue_id) solution = get_or_none(Solution, issue=issue, programmer=user) if(solution): _throwIfSolutionInProgress(solution, user, 'add solution') solution.reopen() else: solution = Solution.newSolution(issue, user) solution.save() comment = None if(comment_content): comment = IssueComment.newComment(issue, user, comment_content) comment.save() notifySponsors_workbegun(solution, comment) return issue
def add_solution_to_existing_issue(issue_id, comment_content, user): issue = Issue.objects.get(pk=issue_id) issue.touch() solution = get_or_none(Solution, issue=issue, programmer=user) if(solution): _throwIfSolutionInProgress(solution, user, 'add solution') solution.reopen() else: solution = Solution.newSolution(issue, user) solution.save() comment = None if(comment_content): comment = IssueComment.newComment(issue, user, comment_content) comment.save() watches = watch_services.find_issue_watches(solution.issue) notifyWatchers_workbegun(solution, comment, watches) return issue
def add_solution_to_existing_issue(issue_id, comment_content, accepting_payments, user): issue = Issue.objects.get(pk=issue_id) solution = get_or_none(Solution, issue=issue, programmer=user) if(solution): _throwIfSolutionInProgress(solution, user, 'add solution') solution.reopen(accepting_payments) else: solution = Solution.newSolution(issue, user, accepting_payments) solution.save() issue.update_redundant_fields(); comment = None if(comment_content): comment = IssueComment.newComment(issue, user, comment_content) comment.save() watches = watch_services.find_issue_and_project_watches(solution.issue) notifyWatchers_workbegun(solution, comment, watches) if(accepting_payments): notifyWatchers_acceptingpayments(solution, watches) return solution, comment