diff --git a/epictrack-api/migrations/versions/b7a3fafa6f1b_set_new_work_types_to_active.py b/epictrack-api/migrations/versions/b7a3fafa6f1b_set_new_work_types_to_active.py new file mode 100644 index 000000000..e3dc7c84b --- /dev/null +++ b/epictrack-api/migrations/versions/b7a3fafa6f1b_set_new_work_types_to_active.py @@ -0,0 +1,30 @@ +"""set new work_types to active + +Revision ID: b7a3fafa6f1b +Revises: c3af13f44bed +Create Date: 2024-09-14 15:39:51.264872 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'b7a3fafa6f1b' +down_revision = 'c3af13f44bed' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.execute("UPDATE work_types SET is_active = true WHERE name = 'EAC Extension'") + op.execute("UPDATE work_types SET is_active = true WHERE name = 'EAC/Order Transfer'") + op.execute("UPDATE work_types SET name = 'Substantial Start Determination', is_active = true WHERE name = 'Substantial Start Decision'") + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### \ No newline at end of file diff --git a/epictrack-api/src/api/reports/resource_forecast_report.py b/epictrack-api/src/api/reports/resource_forecast_report.py index d36cb9e4c..23a42f0f5 100644 --- a/epictrack-api/src/api/reports/resource_forecast_report.py +++ b/epictrack-api/src/api/reports/resource_forecast_report.py @@ -694,6 +694,7 @@ def _get_work_team_members(self, work_id) -> Tuple[List[str], str]: 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) .add_columns( Staff.first_name.label("first_name"),