fix: correct document status change parameters and enum handling
This commit is contained in:
parent
6eba416f72
commit
4867b114fe
1 changed files with 1 additions and 3 deletions
4
api.py
4
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}",
|
||||
|
|
|
|||
Loading…
Reference in a new issue