Exemplo n.º 1
0
def move_file_to_clipboard(request):
    if request.method=='POST':
        file_id = request.POST.get("file_id", None)
        clipboard = tools.get_user_clipboard(request.user)
        if file_id:
            file = Image.objects.get(id=file_id)
            tools.move_file_to_clipboard([file], clipboard)
    return HttpResponseRedirect( '%s%s' % (request.POST.get('redirect_to', ''), popup_param(request) ) )
Exemplo n.º 2
0
def move_file_to_clipboard(request):
    print "move file"
    if request.method == "POST":
        file_id = request.POST.get("file_id", None)
        clipboard = tools.get_user_clipboard(request.user)
        if file_id:
            file = Image.objects.get(id=file_id)
            if file.has_edit_permission(request):
                tools.move_file_to_clipboard([file], clipboard)
            else:
                raise PermissionDenied
    return HttpResponseRedirect("%s%s" % (request.POST.get("redirect_to", ""), popup_param(request)))