Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compliance-api/src/compliance_api/services/case_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from compliance_api.models.complaint import ComplaintStatusEnum
from compliance_api.models.db import db, session_scope
from compliance_api.models.inspection import Inspection as InspectionModel
from compliance_api.models.inspection.inspection_enum import InspectionStatusEnum
from compliance_api.models.order import Order as OrderModel
from compliance_api.models.project import Project as ProjectModel
from compliance_api.models.restorative_justice import RestorativeJustice as RestorativeJusticeModel
Expand Down Expand Up @@ -801,6 +802,7 @@ def _build_case_level_query(case_file_id: int):
InspectionModel.case_file_id == case_file_id,
InspectionModel.is_active.is_(True),
InspectionModel.is_deleted.is_(False),
InspectionModel.inspection_status == InspectionStatusEnum.OPEN,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do want closed inspection to be returned here as well because a closed inspection can still have an open enforcement like an AP. and that open AP should still stop the case file from closing. See comp-784

)
)
.all()
Expand Down
Loading