Skip to content

Fix 500 on Total credits earned report when a single student fails - #2012

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:fix/credits-earned-report-500
Oct 7, 2026
Merged

vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:fix/credits-earned-report-500

Conversation

@vikrantwiz02

@vikrantwiz02 vikrantwiz02 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The Database "Total credits earned" report was returning 500 in production (GET /aims/api/database/credits-earned/?batch=2023).
  • Root cause: _build_grade_validation_semesters is already used elsewhere in production, but always for a single student (Grade Validation). This report runs it across an entire batch via a thread pool, so one student with an edge-case record failed the whole batch's request.
  • _credits_earned_row now catches per-student failures, logs the traceback with the roll number to /tmp/fusion_credits_earned_error.log on the server for diagnosis, and returns a zeroed row flagged "error": true instead of failing the whole request.

Test plan

  • python -m py_compile on the modified file.
  • Confirm the report now loads for batch 2023 in production and check /tmp/fusion_credits_earned_error.log for which student(s) triggered it.

_build_grade_validation_semesters was already in production but only
ever called for one student at a time (Grade Validation). The new
Database "Total credits earned" report runs it across an entire
batch via a thread pool, so a single student with an edge-case
record was taking the whole batch's report down with a 500.
_credits_earned_row now catches per-student failures, logs the
traceback with the roll number to /tmp/fusion_credits_earned_error.log
for diagnosis, and returns a zeroed row flagged "error": true instead
of failing the request.
@vikrantwiz02
vikrantwiz02 force-pushed the fix/credits-earned-report-500 branch from 3ec960b to 6afa794 Compare October 7, 2026 19:47
@vikrantwiz02
vikrantwiz02 merged commit f9c1fd9 into FusionIIIT:prod/acad-react Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant