Example #1
0
def new_comment_solution(request, solution):
    comment = comments_logic.new_comment(request)
    if comment:
        print "adding comment to solution"
        solution.comments.add(comment)
        return True
    else:
        print "something went wrong, couldn't create a new comment for problem."
        return False
Example #2
0
def new_comment_problem(request, problem):
    """ Add a comment to a given problem.
    """
    comment = comments_logic.new_comment(request)
    if comment:
        problem.comments.add(comment)
        return True
    else:
        print "something went wrong, couldn't create a new comment for problem."
        return False