fix: change exclude_none to exclude_unset in article creation/update
This commit is contained in:
parent
44675f69ac
commit
963118641b
1 changed files with 2 additions and 2 deletions
4
api.py
4
api.py
|
|
@ -1098,7 +1098,7 @@ def creer_article(article: ArticleCreateRequest):
|
|||
- 500: Erreur Sage
|
||||
"""
|
||||
try:
|
||||
resultat = sage_client.creer_article(article.dict(exclude_none=True))
|
||||
resultat = sage_client.creer_article(article.dict(exclude_unset=True))
|
||||
|
||||
logger.info(f"✅ Article créé: {resultat.get('reference')}")
|
||||
|
||||
|
|
@ -1137,7 +1137,7 @@ def modifier_article(reference: str, article: ArticleUpdateRequest):
|
|||
"""
|
||||
try:
|
||||
# Filtrer les champs None
|
||||
article_data = article.dict(exclude_none=True)
|
||||
article_data = article.dict(exclude_unset=True)
|
||||
|
||||
if not article_data:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
Loading…
Reference in a new issue