Skip to content

Commit

Permalink
fix duplicate results in cor_ch_status request
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Corny committed Apr 10, 2024
1 parent d062c57 commit 5549d73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/gn_module_zh/model/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion backend/gn_module_zh/nomenclatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5549d73

Please sign in to comment.