From 88f124c991009991ca0e76c3e414b8c745b524e3 Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Tue, 4 Aug 2026 20:42:06 +0200 Subject: [PATCH] fix of the json upload format --- Web/app.py | 3 ++- Web/templates/upload_batch.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Web/app.py b/Web/app.py index 8041ed2..7541c85 100755 --- a/Web/app.py +++ b/Web/app.py @@ -11864,6 +11864,7 @@ def batch_upload_page(): @app.route('/upload_csv_batch', methods=['POST']) +@csrf.exempt def upload_csv_batch(): """ Route for batch adding new items to the inventory via CSV. @@ -11903,7 +11904,7 @@ def upload_csv_batch(): # 2. CSV Einlesen und Validieren try: - df = pd.read_csv(csv_file) + df = pd.read_csv(csv_file, sep=';') except Exception as e: app.logger.error(f"[Upload {upload_session_id}] Fehler beim Lesen der CSV: {str(e)}") return jsonify({"success": False, "message": f"Fehler beim Lesen der CSV: {str(e)}"}), 400 diff --git a/Web/templates/upload_batch.html b/Web/templates/upload_batch.html index b998285..9f37a79 100644 --- a/Web/templates/upload_batch.html +++ b/Web/templates/upload_batch.html @@ -221,7 +221,7 @@ document.getElementById('batchUploadForm').addEventListener('submit', async func log(`${uniqueDataRows.length} einzigartige Einträge gefunden. ${duplicateCount} Duplikate entfernt.`); // Den Index der "Images" Spalte finden - const headers = header.split(','); + const headers = header.split(';'); const imagesColIndex = headers.findIndex(h => h.trim().replace(/['"]/g, '') === 'Images'); // 4. In Batches (Häppchen) aufteilen