From ff51a5cedcbe30a7b6b7b179a731617583b85866 Mon Sep 17 00:00:00 2001 From: Shaelyn Tolkamp <46355612+tolkamps1@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:32:29 -0800 Subject: [PATCH] [Track-298] Filter RF team member query by active staff (#2462) --- .../src/api/reports/resource_forecast_report.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/epictrack-api/src/api/reports/resource_forecast_report.py b/epictrack-api/src/api/reports/resource_forecast_report.py index a914c0a2b..e338c278f 100644 --- a/epictrack-api/src/api/reports/resource_forecast_report.py +++ b/epictrack-api/src/api/reports/resource_forecast_report.py @@ -727,9 +727,14 @@ def _get_work_team_members(self, work_id) -> Tuple[List[str], str]: work_lead = "" work_team_members = ( db.session.query(StaffWorkRole) - .filter(StaffWorkRole.work_id == work_id) - .filter(StaffWorkRole.is_active.is_(True)) .join(Staff, Staff.id == StaffWorkRole.staff_id) + .filter( + StaffWorkRole.work_id == work_id, + StaffWorkRole.is_deleted.is_(False), + StaffWorkRole.is_active.is_(True), + Staff.is_active.is_(True), + Staff.is_deleted.is_(False) + ) .add_columns( Staff.first_name.label("first_name"), Staff.last_name.label("last_name"),