Пример #1
0
def post_node_was_unflagged_message(path, user):
    post = Post()
    post.location = backend.get_node_for_path(path)
    post.author = get_system_user()
    post.post_type = Post.SPAM_UNMARKED
    post.save()
    post.mentions = [user]
    post.node_references = [post.location]
    post.render()
    return post
Пример #2
0
def post_node_was_unflagged_message(path, user):
    post = Post()
    post.location = backend.get_node_for_path(path)
    post.author = get_system_user()
    post.post_type = Post.SPAM_UNMARKED
    post.save()
    post.mentions = [user]
    post.node_references = [post.location]
    post.render()
    return post
Пример #3
0
def post_new_argument_for_node_message(user, path, arg_type, arg_path):
    post = Post()
    post.location = backend.get_node_for_path(path)
    post.author = get_system_user()
    post.post_type = Post.ARGUMENT_CREATED
    post.save()
    post.mentions = [user]
    post.node_references = [backend.get_node_for_path(arg_path), post.location]
    post.render()

    # email notification
    notify_new_argument(post.location, post)
    return post
Пример #4
0
def post_new_argument_for_node_message(user, path, arg_type, arg_path):
    post = Post()
    post.location = backend.get_node_for_path(path)
    post.author = get_system_user()
    post.post_type = Post.ARGUMENT_CREATED
    post.save()
    post.mentions = [user]
    post.node_references = [backend.get_node_for_path(arg_path), post.location]
    post.render()

    # email notification
    notify_new_argument(post.location, post)
    return post
Пример #5
0
def post_new_derivate_for_node_message(user, original_path, derivate_path):
    post = Post()

    original_node = backend.get_node_for_path(original_path)
    derivate_node = backend.get_node_for_path(derivate_path)

    post.location = original_node
    post.post_type = Post.NODE_REFINED
    post.author = get_system_user()
    post.save()
    post.node_references = [original_node, derivate_node]
    post.mentions = [user]
    post.render()

    # email notification
    notify_derivate(original_node, post)
    return post
Пример #6
0
def post_new_derivate_for_node_message(user, original_path, derivate_path):
    post = Post()

    original_node = backend.get_node_for_path(original_path)
    derivate_node = backend.get_node_for_path(derivate_path)

    post.location = original_node
    post.post_type = Post.NODE_REFINED
    post.author = get_system_user()
    post.save()
    post.node_references = [original_node, derivate_node]
    post.mentions = [user]
    post.render()

    # email notification
    notify_derivate(original_node, post)
    return post