fix of the json upload format
This commit is contained in:
+2
-1
@@ -11864,6 +11864,7 @@ def batch_upload_page():
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/upload_csv_batch', methods=['POST'])
|
@app.route('/upload_csv_batch', methods=['POST'])
|
||||||
|
@csrf.exempt
|
||||||
def upload_csv_batch():
|
def upload_csv_batch():
|
||||||
"""
|
"""
|
||||||
Route for batch adding new items to the inventory via CSV.
|
Route for batch adding new items to the inventory via CSV.
|
||||||
@@ -11903,7 +11904,7 @@ def upload_csv_batch():
|
|||||||
|
|
||||||
# 2. CSV Einlesen und Validieren
|
# 2. CSV Einlesen und Validieren
|
||||||
try:
|
try:
|
||||||
df = pd.read_csv(csv_file)
|
df = pd.read_csv(csv_file, sep=';')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
app.logger.error(f"[Upload {upload_session_id}] Fehler beim Lesen der CSV: {str(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
|
return jsonify({"success": False, "message": f"Fehler beim Lesen der CSV: {str(e)}"}), 400
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ document.getElementById('batchUploadForm').addEventListener('submit', async func
|
|||||||
log(`${uniqueDataRows.length} einzigartige Einträge gefunden. ${duplicateCount} Duplikate entfernt.`);
|
log(`${uniqueDataRows.length} einzigartige Einträge gefunden. ${duplicateCount} Duplikate entfernt.`);
|
||||||
|
|
||||||
// Den Index der "Images" Spalte finden
|
// Den Index der "Images" Spalte finden
|
||||||
const headers = header.split(',');
|
const headers = header.split(';');
|
||||||
const imagesColIndex = headers.findIndex(h => h.trim().replace(/['"]/g, '') === 'Images');
|
const imagesColIndex = headers.findIndex(h => h.trim().replace(/['"]/g, '') === 'Images');
|
||||||
|
|
||||||
// 4. In Batches (Häppchen) aufteilen
|
// 4. In Batches (Häppchen) aufteilen
|
||||||
|
|||||||
Reference in New Issue
Block a user