fix(scores,reports): fix scores/history 500, disable unfinished report generation cleanly
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
- /scores/history was annotated -> dict but the service actually returns a list, so FastAPI's response validation raised an unhandled exception, surfacing as a raw 500 on every call. Fixed the annotation. - The professional_reports.py endpoints (PDF/DOCX/HTML generation) back a Reports feature the frontend already hides entirely (unfinished). Hitting them directly fell through to whatever the render pipeline raised (e.g. missing weasyprint system deps) as an unhelpful 500. Added a REPORTS_ENABLED setting (off by default) so they now return a clean 503 instead, without removing the routes or their test coverage.
This commit is contained in:
@@ -165,7 +165,7 @@ def score_history(
|
||||
db: Session = Depends(get_db),
|
||||
# Entry: current_user
|
||||
current_user: User = Depends(get_current_user),
|
||||
) -> dict:
|
||||
) -> list:
|
||||
"""Get historical score data points (weekly).
|
||||
|
||||
Args:
|
||||
@@ -174,7 +174,7 @@ def score_history(
|
||||
current_user (User): Authenticated user making the request.
|
||||
|
||||
Returns:
|
||||
dict: Weekly score data points for the requested period.
|
||||
list: Weekly score data points for the requested period.
|
||||
"""
|
||||
# Return get_score_history(db, period)
|
||||
return get_score_history(db, period)
|
||||
|
||||
Reference in New Issue
Block a user