Temporarily disable CSV uploads

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Repinoid
2026-10-23 13:09:07 +03:00
co-authored by Copilot
parent 49171c93f9
commit 704d41e027
6 changed files with 39 additions and 12 deletions
+9 -2
View File
@@ -42,13 +42,20 @@ def _disconnect_exceptions():
def upload():
"""Upload files to session (один или несколько)."""
sid = request.form.get("session", "")
if not sid:
sid = create_session()
uploaded = request.files.getlist("files")
if not uploaded:
log.warning("upload: no files, sid=%s", sid)
return jsonify({"ok": False, "error": "No file"}), 400
# CSV input is temporarily disabled so reliability testing can focus on the
# other document formats. Keep the CSV processing code in the core intact.
if any(safe_name(f.filename).lower().endswith(".csv") for f in uploaded):
log.warning("upload: CSV input is disabled")
return jsonify({"ok": False, "error": "CSV uploads are temporarily disabled"}), 400
if not sid:
sid = create_session()
added = 0
had_unnamed = False
for f in uploaded: