From e0c58fcbd023b677834813f92e86c77146e4427d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Tue, 16 Jun 2026 15:18:36 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20ZIP-=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8?= =?UTF-8?q?=D0=BA=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20PDF/Word,=20exp?= =?UTF-8?q?anded=20=D1=82=D0=BE=D0=B6=D0=B5=20=D0=BF=D1=80=D0=BE=D0=BF?= =?UTF-8?q?=D1=83=D1=81=D0=BA=D0=B0=D1=82=D1=8C=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=B5,=20v1.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 5 +++-- site/templates/upload.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/site/app.py b/site/app.py index d9bfc4f..5270a5b 100644 --- a/site/app.py +++ b/site/app.py @@ -150,7 +150,7 @@ class ContractsApp: for s in supp_rows: # Пропустить уже распарсенные existing, _ = db.query( - "SELECT 1 FROM documents WHERE id=%s AND status='parsed'", (s["doc_id"],) + "SELECT 1 FROM documents WHERE id=%s AND status IN ('parsed','expanded')", (s["doc_id"],) ) if existing and existing["rows"]: continue @@ -179,7 +179,6 @@ class ContractsApp: for zname in zf.namelist(): if zname.endswith("/"): continue - zip_names.append(zname) zdata = zf.read(zname) zmime = mimeutil.guess_mime(zname) or "application/octet-stream" @@ -191,6 +190,8 @@ class ContractsApp: ): continue + zip_names.append(zname) + # Сохранить как отдельный документ db.execute( "INSERT INTO documents (filename, mime_type, original_bytes, status) VALUES (%s,%s,%s,'uploaded')", diff --git a/site/templates/upload.html b/site/templates/upload.html index f2119e5..90dba85 100644 --- a/site/templates/upload.html +++ b/site/templates/upload.html @@ -47,7 +47,7 @@
Nubes - Сверка договоров v1.7 + Сверка договоров v1.8