From f7b50f642e4da22a388eb3cfdff9cd3bebc2e300 Mon Sep 17 00:00:00 2001 From: Avery Lee Date: Tue, 17 Dec 2024 13:18:03 -0800 Subject: [PATCH] If there are multiple response costs of the default cost type, the default is the oldest instance. --- src/dispatch/case_cost/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dispatch/case_cost/service.py b/src/dispatch/case_cost/service.py index b6654e2f1f73..23135fd88039 100644 --- a/src/dispatch/case_cost/service.py +++ b/src/dispatch/case_cost/service.py @@ -42,7 +42,8 @@ def get_by_case_id_and_case_cost_type_id( db_session.query(CaseCost) .filter(CaseCost.case_id == case_id) .filter(CaseCost.case_cost_type_id == case_cost_type_id) - .one_or_none() + .order_by(CaseCost.id.asc()) + .first() )