csrf-correction

This commit is contained in:
denis defolie
2026-07-10 09:49:36 +02:00
parent 695e59174a
commit 90d271dc2b
8 changed files with 17 additions and 12 deletions
@@ -58,7 +58,7 @@
});
});
function export_csv(url, pid, mode) {
fetch(url, {
csrfFetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
+1 -3
View File
@@ -11,7 +11,6 @@ from django.contrib import messages
from django.http import JsonResponse, FileResponse
from django.shortcuts import redirect
from django.utils.translation import gettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render #, redirect
from django.views.decorators.http import require_GET
from django.contrib.auth.decorators import login_required
@@ -85,8 +84,7 @@ def get_active_session(request, session_id=None, experiment_id=None):
# Vue :Export CSV depuis ReductStore
# ---------------------------------------------------------------------------
@login_required
@csrf_exempt
def export_metrics(request):
def export_metrics(request):
data = json.loads(request.body.decode() or "{}")
action = data.get("action")
pid = data.get("pid")