def ignore_check(request, check_id): obj = get_object_or_404(Check, pk=int(check_id)) if not can_ignore_check(request.user, obj.project): raise PermissionDenied() obj.project.check_acl(request) # Mark check for ignoring obj.set_ignore() # response for AJAX return HttpResponse('ok')