implementing map on school card; adding more school details
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 59s

This commit is contained in:
Tudor
2026-01-08 23:20:42 +00:00
parent 34f40c0c1c
commit b7943e1042
5 changed files with 294 additions and 14 deletions

View File

@@ -65,11 +65,11 @@ class SecurityHeadersMiddleware(BaseHTTPMiddleware):
# Content Security Policy
response.headers["Content-Security-Policy"] = (
"default-src 'self'; "
"script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; "
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net; "
"script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://unpkg.com; "
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net https://unpkg.com; "
"font-src 'self' https://fonts.gstatic.com; "
"img-src 'self' data:; "
"connect-src 'self' https://cdn.jsdelivr.net; "
"img-src 'self' data: https://*.tile.openstreetmap.org; "
"connect-src 'self' https://cdn.jsdelivr.net https://*.tile.openstreetmap.org; "
"frame-ancestors 'none'; "
"base-uri 'self'; "
"form-action 'self';"
@@ -306,11 +306,8 @@ async def get_schools(
end_idx = start_idx + page_size
schools_df = schools_df.iloc[start_idx:end_idx]
# Remove internal columns before sending (keep distance if present)
output_cols = [c for c in schools_df.columns if c not in ["latitude", "longitude"]]
return {
"schools": clean_for_json(schools_df[output_cols]),
"schools": clean_for_json(schools_df),
"total": total,
"page": page,
"page_size": page_size,

View File

@@ -405,6 +405,10 @@ SCHOOL_COLUMNS = [
"address",
"town",
"postcode",
"religious_denomination",
"age_range",
"latitude",
"longitude",
]
# Local Authority code to name mapping (for fallback when LANAME column missing)