diff --git a/backend/data_loader.py b/backend/data_loader.py index ce51ab1..60883f2 100644 --- a/backend/data_loader.py +++ b/backend/data_loader.py @@ -416,7 +416,14 @@ def get_supplementary_data(db: Session, urn: int) -> dict: "framework": o.framework, "inspection_date": o.inspection_date.isoformat() if o.inspection_date else None, "inspection_type": o.inspection_type, - "overall_effectiveness": o.overall_effectiveness, + # Fall back to the grade parsed from an ungraded (Section 8) outcome + # (e.g. "School remains Good") when there's no graded grade, so the + # detail page matches the list badge. + "overall_effectiveness": ( + o.overall_effectiveness + if o.overall_effectiveness is not None + else o.ungraded_grade + ), "quality_of_education": o.quality_of_education, "behaviour_attitudes": o.behaviour_attitudes, "personal_development": o.personal_development,