Пример #1
0
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)
    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
Пример #5
0
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