Repository navigation
Fix 500 on Total credits earned report when a single student fails - #2012
Merged
vikrantwiz02 merged 1 commit intoOct 7, 2026
Merged
vikrantwiz02 merged 1 commit into
vikrantwiz02 merged 1 commit into
Conversation
_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
force-pushed
the
fix/credits-earned-report-500
branch
from
October 7, 2026 19:47
3ec960b to
6afa794
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /aims/api/database/credits-earned/?batch=2023)._build_grade_validation_semestersis 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_rownow catches per-student failures, logs the traceback with the roll number to/tmp/fusion_credits_earned_error.logon the server for diagnosis, and returns a zeroed row flagged"error": trueinstead of failing the whole request.Test plan
python -m py_compileon the modified file./tmp/fusion_credits_earned_error.logfor which student(s) triggered it.