fix: audit — json try/except, ZIP-bomb drhider, classify reset only processing
Deploy contracts-flask / validate (push) Successful in 0s

This commit is contained in:
2026-06-30 11:25:29 +04:00
parent 8deebc7ac4
commit d17baa767c
6 changed files with 115 additions and 21 deletions
+3 -2
View File
@@ -79,9 +79,10 @@ def list_pending(batch_id):
def reset_classify_status(batch_id):
"""Сбросить classify_status на 'pending' для всех документов батча (включая 'processing' crash recovery)."""
"""Сбросить classify_status на 'pending' только для 'processing' (crash recovery).
Уже классифицированные ('classified', 'garbage', 'failed') НЕ трогаем."""
return execute(
"UPDATE documents SET classify_status='pending', error_message=NULL WHERE batch_id=%s",
"UPDATE documents SET classify_status='pending', error_message=NULL WHERE batch_id=%s AND classify_status='processing'",
(batch_id,),
)