fix: ZIP-счётчик только PDF/Word, expanded тоже пропускать при повторе, v1.8

This commit is contained in:
2026-06-16 15:18:36 +04:00
parent c710a2df7a
commit e0c58fcbd0
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -150,7 +150,7 @@ class ContractsApp:
for s in supp_rows: for s in supp_rows:
# Пропустить уже распарсенные # Пропустить уже распарсенные
existing, _ = db.query( 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"]: if existing and existing["rows"]:
continue continue
@@ -179,7 +179,6 @@ class ContractsApp:
for zname in zf.namelist(): for zname in zf.namelist():
if zname.endswith("/"): if zname.endswith("/"):
continue continue
zip_names.append(zname)
zdata = zf.read(zname) zdata = zf.read(zname)
zmime = mimeutil.guess_mime(zname) or "application/octet-stream" zmime = mimeutil.guess_mime(zname) or "application/octet-stream"
@@ -191,6 +190,8 @@ class ContractsApp:
): ):
continue continue
zip_names.append(zname)
# Сохранить как отдельный документ # Сохранить как отдельный документ
db.execute( db.execute(
"INSERT INTO documents (filename, mime_type, original_bytes, status) VALUES (%s,%s,%s,'uploaded')", "INSERT INTO documents (filename, mime_type, original_bytes, status) VALUES (%s,%s,%s,'uploaded')",
+1 -1
View File
@@ -47,7 +47,7 @@
<body> <body>
<div class="topbar"> <div class="topbar">
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes"> <img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.7</span></span> <span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.8</span></span>
</div> </div>
<div class="content"> <div class="content">