fix move, note to self: understand decorators :(
This commit is contained in:
parent
0c33ce46de
commit
6ecf5ee3c6
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user