From 6ecf5ee3c6f0b2025cea9437d950e04ea11bb245 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 5 Jul 2011 14:18:42 +0530 Subject: [PATCH] fix move, note to self: understand decorators :( --- edgware/files/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/edgware/files/views.py b/edgware/files/views.py index 6415697..a38587f 100644 --- a/edgware/files/views.py +++ b/edgware/files/views.py @@ -314,15 +314,18 @@ def makeFilePublic(request): @csrf_exempt -@user_passes_test_json(canEditFiles) +# @user_passes_test_json(canEditFiles) +@login_required def moveFiles(request): response = {} + user = request.user files = json.loads(request.POST.get("ids", "[]")) study_id = int(request.POST.get("study", "0")) study = Category.objects.get(pk=study_id) for f in files: fil = File.objects.get(pk=f) - fil.move_to(study) + if fil.can_edit(user): + fil.move_to(study) response['status'] = 'pass' return render_to_json_response(errors)