Temporarily disable CSV uploads
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user