diff --git a/backend/gn_module_zh/model/cards.py b/backend/gn_module_zh/model/cards.py index c2f6b142..84caeeb2 100644 --- a/backend/gn_module_zh/model/cards.py +++ b/backend/gn_module_zh/model/cards.py @@ -394,7 +394,7 @@ def __str__(self): cahier_lb_hab_fr = cahier.lb_hab_fr cahier_lb_code = cahier.lb_code priority = ( - DB.session.execute(select(CorChStatus).where(CorChStatus.lb_code == cahier_lb_code)) + DB.session.execute(select(CorChStatus).where(CorChStatus.lb_code == cahier_lb_code).distinct()) .scalar_one() .priority ) diff --git a/backend/gn_module_zh/nomenclatures.py b/backend/gn_module_zh/nomenclatures.py index eaf3e08e..cfab354a 100644 --- a/backend/gn_module_zh/nomenclatures.py +++ b/backend/gn_module_zh/nomenclatures.py @@ -99,7 +99,7 @@ def get_ch(lb_code): "lb_code": hab.lb_code, "lb_hab_fr": hab.lb_hab_fr, "priority": DB.session.execute( - select(CorChStatus).where(CorChStatus.lb_code == hab.lb_code) + select(CorChStatus).where(CorChStatus.lb_code == hab.lb_code).distinct() ) .scalar_one() .priority,