diff --git a/deploy/db/documents.py b/deploy/db/documents.py index cf2ccdb..e6ec1a6 100644 --- a/deploy/db/documents.py +++ b/deploy/db/documents.py @@ -56,7 +56,7 @@ def set_classify_failed(doc_id, error): def list_pending(batch_id): """Documents waiting for classification.""" return query( - "SELECT id, filename, elements_json FROM documents WHERE batch_id=%s AND classify_status='pending' AND status='parsed'", + "SELECT id, filename, elements_json FROM documents WHERE batch_id=%s AND classify_status='pending'", (batch_id,), ) @@ -64,7 +64,7 @@ def list_pending(batch_id): def reset_classify_status(batch_id): """Сбросить classify_status на 'pending' для всех документов батча.""" return execute( - "UPDATE documents SET classify_status='pending', error_message=NULL WHERE batch_id=%s AND status='parsed'", + "UPDATE documents SET classify_status='pending', error_message=NULL WHERE batch_id=%s", (batch_id,), )