From 4867b114fe1520ae55d94bdf591a0f58f01e9cfd Mon Sep 17 00:00:00 2001 From: Fanilo-Nantenaina Date: Tue, 30 Dec 2025 12:50:44 +0300 Subject: [PATCH] fix: correct document status change parameters and enum handling --- api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api.py b/api.py index 1aabde5..17ae027 100644 --- a/api.py +++ b/api.py @@ -900,8 +900,6 @@ async def changer_statut_document( f"ne peut plus changer de statut (statut actuel ≥ 2)", ) - # CORRECTION ICI : utiliser les bons paramètres dans le bon ordre - # Et convertir l'enum en int avec .value si nécessaire document_type_int = document_type_code.value if hasattr(document_type_code, 'value') else type_doc_normalized resultat = sage_client.changer_statut_document( @@ -916,7 +914,7 @@ async def changer_statut_document( "success": True, "document_id": numero, "type_document_code": document_type_int, - "type_document_sql": str(document_type_sql), + "type_document_sql": str(document_type_sql.value), "statut_ancien": resultat.get("statut_ancien", statut_actuel), "statut_nouveau": resultat.get("statut_nouveau", nouveau_statut), "message": f"Statut mis à jour: {statut_actuel} → {nouveau_statut}",