Exemplo n.º 1
0
def store_microblogging(request, path):
    assert_authentication(request)
    assert_post_parameters(request, ['microblogText'])
    post_text = convert_long_urls(request.POST['microblogText'],
                                  request.get_host())
    post = create_post(post_text, request.user, path)
    notify_users(post)
    return json_response({'storeMicrobloggingResponse': {}})
Exemplo n.º 2
0
def store_microblogging(request, path):
    request_data = json.loads(request.body)
    assert_authentication(request)
    assert_permissions(request, ['microblogging.add_post'])
    assert_request_data_parameters(request_data, ['microblogText'])
    post_text = convert_long_urls(request_data['microblogText'],
                                  request.get_host())
    post = create_post(post_text, request.user, path)
    notify_users(post)
    return json_response({'storeMicrobloggingResponse': {}})
Exemplo n.º 3
0
def store_microblog_post(request, path):
    assert_authentication(request)
    assert_post_parameters(request, ['microblogText'])
    create_post(request.POST['microblogText'], request.user, path)
    return json_response({'storeMicrobloggingResponse': {}})