fix(web): protejeaza decriptarea override_json in preview + inchide 3.6 (CLOSE)

decrypt_creds(override_json) era in afara try/except-ului care protejeaza
raw_json in preview_import (import_router) si _web_compute_preview (routes).
La rotatie cheie Fernet (risc acceptat R4) sau token corupt, raw_json degrada
gratios la {} dar override_json arunca 500 pe tot batch-ul. Acum ambalat
identic (fallback None -> {}).

Prins de /code-review high la CLOSE. Writeback: ROADMAP 3.6 -> DONE,
PRD -> inchis + Raport CLOSE. Duplicare _override_of/canonicalize notata
ca cleanup viitor (disciplina backend-neatins). 523 teste pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-06-22 09:09:03 +00:00
parent 178bc87006
commit 35f35d03cc
4 changed files with 42 additions and 5 deletions

View File

@@ -696,7 +696,10 @@ def preview_import(
rows.append(row_data or {})
except Exception:
rows.append({})
ov = decrypt_creds(r["override_json"]) if r["override_json"] else None
try:
ov = decrypt_creds(r["override_json"]) if r["override_json"] else None
except Exception:
ov = None
overrides.append(ov or {})
# Obtine coloanele