fix(ofsted): apply ungraded fallback on school detail page too
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 18s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 52s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 18s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

The detail page reads overall_effectiveness from the API and showed
"Not rated" for ungraded-only schools, even though the list badge uses
the coalesced grade. Coalesce the ungraded fallback into the API's
overall_effectiveness so the detail page shows the same grade.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-07-01 22:11:45 +01:00
co-authored by Claude Opus 4.8
parent 34fd4a6bcd
commit 9e4cf9dfbf
+8 -1
View File
@@ -416,7 +416,14 @@ def get_supplementary_data(db: Session, urn: int) -> dict:
"framework": o.framework, "framework": o.framework,
"inspection_date": o.inspection_date.isoformat() if o.inspection_date else None, "inspection_date": o.inspection_date.isoformat() if o.inspection_date else None,
"inspection_type": o.inspection_type, "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, "quality_of_education": o.quality_of_education,
"behaviour_attitudes": o.behaviour_attitudes, "behaviour_attitudes": o.behaviour_attitudes,
"personal_development": o.personal_development, "personal_development": o.personal_development,